void Awake() { _detector = transform.GetChild(0).GetComponent <PlayerDetection>(); _postSearch = GetComponentInChildren <FindPlayer>(); _patrolBehav = GetComponent <Patrol>(); _spriteHand = GetComponent <Spritehandler>(); _coneRender = transform.GetChild(0).GetComponent <VisionConeRender>(); }
public void Start() { scoreScript = GetComponent <GameSceneScript> (); findPlayerScript = GetComponent <FindPlayer>(); startPositions = new int[] { 0, 0 }; chosenPositions = new int[] { 0, 0 }; //Find next player to pass ball to isCorrect = true; LoadNextQuestion(); }
} // static singleton void Awake() { if (Instance == null) { Instance = this; } else { Destroy(gameObject); } // Cache references to all desired variables player = FindObjectOfType <CharacterController2D>(); }
// Start is called before the first frame update void Start() { GameObject FindPlayerObject = GameObject.FindWithTag("FindPlayer"); if (FindPlayerObject != null) { findPlayer = FindPlayerObject.GetComponent <FindPlayer> (); } else { Debug.Log("找不到tag为FindPlayer"); } if (findPlayer == null) { Debug.Log("找不到 findPlayer 脚本"); } switch (FindPlayer.index) { case 0: { Player = GameObject.Find("StarSparrow1 Variant 1"); Player2.SetActive(false); Player3.SetActive(false); break; } case 1: { Player = GameObject.Find("StarSparrow3"); Player1.SetActive(false); Player3.SetActive(false); break; } case 2: { Player = GameObject.Find("StarSparrow4"); Player1.SetActive(false); Player2.SetActive(false); break; } default: break; } life = 3; score = 0; scoreText.text = "得分: " + score; HPText.text = "\n\nHP: " + life; gameOver_Canves.SetActive(false); StartCoroutine(process()); }
// Use this for initialization void Start() { Transform paret = transform.parent; if (paret == null) { return; } FindPlayer findPlayer = paret.GetComponent <FindPlayer>(); if (findPlayer == null) { return; } VisionDistance = findPlayer.VisionDistance; }
public ai_1() { { SelectorLinear node1 = new SelectorLinear(); this.AddChild(node1); { SequenceLinear node2 = new SequenceLinear(); node1.AddChild(node2); { IsPlayerInAttackRange node3 = new IsPlayerInAttackRange(); node2.AddChild(node3); } { Attack node4 = new Attack(); node2.AddChild(node4); } } { SequenceLinear node5 = new SequenceLinear(); node1.AddChild(node5); { CanNotFindPlayer node6 = new CanNotFindPlayer(); node5.AddChild(node6); } { Patrol node7 = new Patrol(); node7.PatrolRange = 5; node5.AddChild(node7); } } { SequenceLinear node8 = new SequenceLinear(); node1.AddChild(node8); { FindPlayer node9 = new FindPlayer(); node8.AddChild(node9); } { Chase node10 = new Chase(); node8.AddChild(node10); } } } }
// Start is called before the first frame update void Start() { GameObject FindPlayerObject = GameObject.FindWithTag("FindPlayer"); if (FindPlayerObject != null) { findPlayer = FindPlayerObject.GetComponent <FindPlayer> (); } else { Debug.Log("找不到tag为FindPlayer"); } if (findPlayer == null) { Debug.Log("找不到 findPlayer 脚本"); } choose1.transform.GetComponent <Renderer>().enabled = true; choose2.transform.GetComponent <Renderer>().enabled = false; choose3.transform.GetComponent <Renderer>().enabled = false; }
public CheckPlayer(FindPlayer find, bool isNotUpdate = false) { m_Find = find; m_isFind = false; m_isNotUpdate = isNotUpdate; }
void OnEnable() { FindPlayer = (FindPlayer)target; }
void Awake() { instance = this; }
void Awake() { Instance = this; }