void OnSceneGUI() { if (Application.isPlaying) { return; } AIFlag parent = aibox.transform.parent.GetComponent <AIFlag>(); if (parent == null) { return; } Handles.color = parent.Colour; Handles.DrawWireArc(parent.transform.position, parent.transform.forward, -parent.transform.right, 360, parent.Radius); Handles.BeginGUI(); Vector2 pos = HandleUtility.WorldToGUIPoint(parent.transform.position); GUI.DrawTexture(new Rect(pos.x - 10f, pos.y - 10f, 20f, 20f), parent.Icon, ScaleMode.ScaleToFit, true, 0, parent.Colour, Vector4.zero, 0); pos = HandleUtility.WorldToGUIPoint(aibox.transform.position); GUI.DrawTexture(new Rect(pos.x - 10f, pos.y - 10f, 20f, 20f), aibox.Icon, ScaleMode.ScaleToFit, true, 0, parent.Colour, Vector4.zero, 0); Handles.EndGUI(); }
void OnEnable() { style.fontStyle = FontStyle.Bold; style.normal.textColor = Color.white; aiflag = (AIFlag)target; }
public void spawn(GameObject spawner) { RaycastHit2D hit = Physics2D.Raycast(transform.position, Vector2.down, 10, walkable_mask); if (hit.collider != null) { transform.position = hit.point; } respawn_point = transform.position; PatrolBoundary = spawner.transform.parent.GetComponent <AIFlag>(); }
void Awake() { S_Amove = GetComponent <AIMove>(); S_Aflag = GetComponent <AIFlag>(); S_Agun = GetComponent <AIGun>(); S_Asearch = GetComponent <AIRouteSearch>(); S_Alife = GetComponent <AILife>(); S_Atrans = GetComponent <AITransChange>(); S_Team = GetComponent <TeamScript>(); RegisterEvent_ChangeState(SetNowState); RegisterEvent_ChangeFindEnemyFlag(SetFindEnemyFlag); S_Aflag.RegisterEvent_ChangeHaveFlag(ChangeFlagState); }