API
Coder李
生活不止眼前的苟且,还有诗和远方的田野。
展开
-
UnityAPI—GetComponent
public class API05GetComponent : MonoBehaviour { public GameObject target; // Use this for initialization void Start () { Cube cube = target.GetComponent<Cube>(); ...原创 2018-08-26 09:27:34 · 794 阅读 · 0 评论 -
UnityAPI—Time类
using System.Collections;using System.Collections.Generic;using UnityEngine;public class API02Time : MonoBehaviour { public Transform cube; public int runCount = 10000; // Use this f...原创 2018-08-25 11:10:29 · 235 阅读 · 0 评论 -
UnityAPI—GameObject
using System.Collections;using System.Collections.Generic;using UnityEngine;public class API03GameObject : MonoBehaviour { public GameObject go; // Use this for initialization void S...原创 2018-08-25 14:31:08 · 161 阅读 · 0 评论 -
UnityAPI—Physics Raycast
public class Player : MonoBehaviour { // Use this for initialization void Start () { } // Update is called once per frame void Update () { Ray ray = new Ray...原创 2018-09-04 12:23:39 · 222 阅读 · 0 评论 -
UnityAPI—UGUI Events
using System.Collections;using System.Collections.Generic;using System;using UnityEngine;using UnityEngine.UI;public class UIEventManager : MonoBehaviour { public GameObject btnGameObject;...原创 2018-09-04 12:25:10 · 311 阅读 · 0 评论 -
UnityAPI—WWW类
public class WWWTest : MonoBehaviour { public string url = "https://ss0.bdstatic.com/70cFuHSh_Q1YnxGkpoWK1HF6hhy/it/u=2622066562,1466948874&fm=27&gp=0.jpg"; IEnumerator Start() {...原创 2018-09-04 12:25:57 · 154 阅读 · 0 评论 -
UnityAPI—Touch
public class TouchTest : MonoBehaviour { // Use this for initialization void Start () { } // Update is called once per frame void Update () { //Debug.Log(In...原创 2018-09-04 12:26:38 · 204 阅读 · 0 评论 -
UnityAPI—Camera类
public class CameraTest : MonoBehaviour { private Camera camera; // Use this for initialization void Start () { camera = Camera.main; } // Update is called once per...原创 2018-09-04 12:27:25 · 439 阅读 · 0 评论 -
UnityAPI—CharacterController
public class PlayerCC : MonoBehaviour { public float speed = 3; private CharacterController cc; // Use this for initialization void Start () { cc = GetComponent<Character...原创 2018-09-04 12:28:11 · 191 阅读 · 0 评论 -
UnityAPI—Mesh
public class MeshAndMat : MonoBehaviour { public Mesh mesh; private Material mat; // Use this for initialization void Start () { //GetComponent<MeshFilter>().sharedMe...原创 2018-09-04 12:31:12 · 173 阅读 · 0 评论 -
UnityAPI—变更
using System.Collections;using System.Collections.Generic;using UnityEngine;using UnityEngine.SceneManagement;public class UnityAPIChange : MonoBehaviour { private Rigidbody rgd; // Use ...原创 2018-09-04 12:31:59 · 1416 阅读 · 0 评论 -
UnityAPI—Message
using System.Collections;using System.Collections.Generic;using UnityEngine;public class API04Message : MonoBehaviour { public GameObject target; // Use this for initialization void...原创 2018-08-25 18:55:18 · 155 阅读 · 0 评论 -
UnityAPI—EventFunction(事件函数)
using System.Collections;using System.Collections.Generic;using UnityEngine;public class API01EventFunction : MonoBehaviour { void Awake() { Debug.Log("Awake"); } void On...原创 2018-08-25 09:56:12 · 987 阅读 · 0 评论 -
UnityAPI—SceneManager类
using System.Collections;using System.Collections.Generic;using UnityEngine;using UnityEngine.SceneManagement;public class API19SceneManager : MonoBehaviour { // Use this for initialization...原创 2018-08-29 08:12:42 · 842 阅读 · 0 评论 -
UnityAPI—Application类
public class API17Application_xxxPath : MonoBehaviour { void Start() { print(Application.dataPath); print(Application.streamingAssetsPath); print(Application.persiste...原创 2018-08-29 08:11:02 · 353 阅读 · 0 评论 -
UnityAPI—MonoBehaviour
public class API06MonoBehaviour : MonoBehaviour { public Cube cube; // Use this for initialization void Start () { Debug.Log(this.isActiveAndEnabled); Debug.Log(this.ena...原创 2018-08-26 09:48:59 · 153 阅读 · 0 评论 -
UnityAPI—Invoke
public class API07Invoke : MonoBehaviour { // Use this for initialization void Start () { //Invoke("Attack",3); InvokeRepeating("Attack", 4, 2); CancelInvoke("Att...原创 2018-08-26 09:57:26 · 146 阅读 · 0 评论 -
UnityAPI—Coroutine
public class API08Coroutine : MonoBehaviour { public GameObject cube; // Use this for initialization void Start () { //print("hha"); ////ChangeColor(); //StartCor...原创 2018-08-26 17:50:06 · 149 阅读 · 0 评论 -
UnityAPI—OnMouseEventFunction
public class API09OnMouseEventFunction : MonoBehaviour { void OnMouseDown() { print("Down"+gameObject); } void OnMouseUp() { print("up" + gameObject); } ...原创 2018-08-26 17:56:10 · 162 阅读 · 0 评论 -
UnityAPI—Mathf
public class API10Mathf : MonoBehaviour { public Transform cube; public int a = 8; public int b = 20; public float t = 0; public float speed = 3; // Use this for initializati...原创 2018-08-26 17:56:55 · 109 阅读 · 0 评论 -
UnityAPI—Input类
public class API11Input : MonoBehaviour { public Transform cube; // Use this for initialization void Start () { } // Update is called once per frame void Updat...原创 2018-08-29 08:04:46 · 244 阅读 · 0 评论 -
UnityAPI—Vector类
public class API12Vector2 : MonoBehaviour { // Use this for initialization void Start() { //print(Vector2.down); //print(Vector2.up); //print(Vector2.left); ...原创 2018-08-29 08:05:40 · 278 阅读 · 0 评论 -
UnityAPI—Random类
public class API13Random : MonoBehaviour { public Transform cube; // Use this for initialization void Start () { //Random.InitState( (int)System.DateTime.Now.Ticks ); }...原创 2018-08-29 08:06:58 · 157 阅读 · 0 评论 -
UnityAPI—Quaternion类
public class API14Quaternion : MonoBehaviour { public Transform cube; public Transform player; public Transform enemy; // Use this for initialization void Start() { ...原创 2018-08-29 08:08:21 · 228 阅读 · 0 评论 -
UnityAPI—Rigidbody类
public class API15RigidbodyPosition : MonoBehaviour { public Rigidbody playerRgd; public Transform enemy; public int force; // Use this for initialization void Start () { ...原创 2018-08-29 08:09:24 · 213 阅读 · 0 评论 -
UnityAPI—Camera类
public class API16Camera : MonoBehaviour { private Camera mainCamera; // Use this for initialization void Start () { //mainCamera= GameObject.Find("MainCamera").GetComponent<C...原创 2018-08-29 08:10:11 · 274 阅读 · 0 评论 -
UnityAPI—判断用户是否点击UI界面
UnityEngine.EventSystems.EventSystem.current.IsPointerOverGameObject();原创 2018-10-17 21:23:40 · 681 阅读 · 0 评论