public void OnSceneGUI() { CosmoController cosmo = (CosmoController)target; //Show the current state in the editor if (cosmo.GetState() == cosmo.idle_state) { Handles.Label(cosmo.transform.position, "IDLE"); } if (cosmo.GetState() == cosmo.walking_state) { Handles.Label(cosmo.transform.position, "WALKING"); } if (cosmo.GetState() == cosmo.hiding_state) { Handles.Label(cosmo.transform.position, "HIDING"); } if (cosmo.GetState() == cosmo.sensorial_state) { Handles.Label(cosmo.transform.position, "SENSORIAL"); } if (cosmo.GetState() == cosmo.portal_state) { Handles.Label(cosmo.transform.position, "PORTAL"); } Handles.color = Color.blue; Handles.DrawWireArc(cosmo.transform.position, Vector3.up, Vector3.forward, 360, cosmo.max_detection_radius); }
void Awake() { cosmo = GameObject.Find("Cosmo").GetComponent <CosmoController>(); nyx = GameObject.Find("Nyx").GetComponent <NyxController>(); barion = GameObject.Find("Barion").GetComponent <BarionController>(); cursor = GameObject.Find("Cursor").GetComponent <CursorManager>(); }
BoxHideInteractable hide_inst; //Hide controller instance void Awake() { barion = GameObject.Find("Barion").GetComponent <BarionController>(); nyx = GameObject.Find("Nyx").GetComponent <NyxController>(); cosmo = GameObject.Find("Cosmo").GetComponent <CosmoController>(); selection_sys = GameObject.Find("SelectionSystem").GetComponent <UnitSelection>(); //Insert all menus in the dictionary RadialMenu_ObjectInteractable[] menus_scripts = GetComponents <RadialMenu_ObjectInteractable>(); foreach (RadialMenu_ObjectInteractable menu_script in menus_scripts) { menus.Add(menu_script.id, menu_script); } hide_inst = GetComponent <BoxHideInteractable>(); }
void OnTriggerEnter(Collider col) { if (col.tag == Tags.player && col.name != Objects.barion) { if (col.name == Objects.cosmo) //Cosmo { CosmoController cosmo = col.gameObject.GetComponent <CosmoController>(); if (cosmo.GetState() == cosmo.idle_state) { cosmo.ChangeStateTo(cosmo.chained_state); } } if (col.name == Objects.nyx) //Nyx { NyxController nyx = col.gameObject.GetComponent <NyxController>(); if (nyx.GetState() == nyx.idle_state) { nyx.ChangeStateTo(nyx.chained_state); } } } }
private Vector3 destination = new Vector3(); //Pathfinding destination public CosmoWalkingState(CosmoController cosmo_controller) { cosmo = cosmo_controller; }
public CosmoPortalState(CosmoController cosmo_controller) { cosmo = cosmo_controller; }
private Vector3 destination = new Vector3(); //Pathfinding destination. public CosmoIdleState(CosmoController cosmo_controller) { cosmo = cosmo_controller; }
Vector3 destination = new Vector3(); //Pathfinding public CosmoChainedState(CosmoController cosmo_controller, Transform barion) { cosmo = cosmo_controller; barion_position = barion; agent = cosmo.agent; }
LayerMask detection_mask; //Layers that will be detected by the ability. public CosmoSensorialState(CosmoController cosmo_controller) { cosmo = cosmo_controller; detection_mask = LayerMask.GetMask("Enemy"); }