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);
    }
示例#2
0
    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>();
    }
示例#3
0
    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>();
    }
示例#4
0
    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;
 }
示例#7
0
    private Vector3 destination = new Vector3(); //Pathfinding destination.

    public CosmoIdleState(CosmoController cosmo_controller)
    {
        cosmo = cosmo_controller;
    }
示例#8
0
    Vector3 destination = new Vector3(); //Pathfinding

    public CosmoChainedState(CosmoController cosmo_controller, Transform barion)
    {
        cosmo           = cosmo_controller;
        barion_position = barion;
        agent           = cosmo.agent;
    }
示例#9
0
    LayerMask detection_mask;                                          //Layers that will be detected by the ability.

    public CosmoSensorialState(CosmoController cosmo_controller)
    {
        cosmo          = cosmo_controller;
        detection_mask = LayerMask.GetMask("Enemy");
    }