void Awake()
    {
        pGoodGuysContainer = GameObject.Find("GoodGuys").GetComponent<CharactersControl>();
        pPlayer = pGoodGuysContainer.gameObject.transform.GetChild(m_iPlayerNum).gameObject.GetComponentInChildren<Player>();

        EventTrigger.Entry tEntry = new EventTrigger.Entry();
        tEntry.eventID = EventTriggerType.PointerUp;
        tEntry.callback.AddListener(delegate { pGoodGuysContainer.SelectCharacter(pPlayer); });
        gameObject.GetComponent<EventTrigger>().triggers.Add(tEntry);
    }
Example #2
0
    void Awake()
    {
        pGoodGuysContainer = GameObject.Find("GoodGuys").GetComponent <CharactersControl>();
        pPlayer            = pGoodGuysContainer.gameObject.transform.GetChild(m_iPlayerNum).gameObject.GetComponentInChildren <Player>();

        EventTrigger.Entry tEntry = new EventTrigger.Entry();
        tEntry.eventID = EventTriggerType.PointerUp;
        tEntry.callback.AddListener(delegate { pGoodGuysContainer.SelectCharacter(pPlayer); });
        gameObject.GetComponent <EventTrigger>().triggers.Add(tEntry);
    }
    void Awake()
    {
        EventTrigger pEventTrigger = gameObject.GetComponent <EventTrigger>();

        pCharactersControl = GameObject.Find("GoodGuys").GetComponent <CharactersControl>();
        EventTrigger.Entry tSendEquip = new EventTrigger.Entry();
        tSendEquip.eventID = EventTriggerType.PointerUp;
        tSendEquip.callback.AddListener(delegate { pCharactersControl.SendEquip(gameObject.name); });
        pEventTrigger.triggers.Add(tSendEquip);

        tIconSelected = transform.GetChild(0).gameObject;
        tIconSelected.SetActive(false);

        pInventoryScript = GameObject.FindObjectOfType <WeaponsIcons>();
        EventTrigger.Entry tPrintWeaponName = new EventTrigger.Entry();
        tPrintWeaponName.eventID = EventTriggerType.PointerEnter;
        tPrintWeaponName.callback.AddListener(delegate { pInventoryScript.PrintWeaponName(gameObject.name); });
        pEventTrigger.triggers.Add(tPrintWeaponName);

        EventTrigger.Entry tClearText = new EventTrigger.Entry();
        tClearText.eventID = EventTriggerType.PointerExit;
        tClearText.callback.AddListener(delegate { pInventoryScript.PrintWeaponName(""); });
        pEventTrigger.triggers.Add(tClearText);
    }
    void Awake()
    {
        EventTrigger pEventTrigger = gameObject.GetComponent<EventTrigger>();

        pCharactersControl = GameObject.Find("GoodGuys").GetComponent<CharactersControl>();
        EventTrigger.Entry tSendEquip = new EventTrigger.Entry();
        tSendEquip.eventID = EventTriggerType.PointerUp;
        tSendEquip.callback.AddListener(delegate { pCharactersControl.SendEquip(gameObject.name); });
        pEventTrigger.triggers.Add(tSendEquip);

        tIconSelected = transform.GetChild(0).gameObject;
        tIconSelected.SetActive(false);

        pInventoryScript = GameObject.FindObjectOfType<WeaponsIcons>();
        EventTrigger.Entry tPrintWeaponName = new EventTrigger.Entry();
        tPrintWeaponName.eventID = EventTriggerType.PointerEnter;
        tPrintWeaponName.callback.AddListener(delegate { pInventoryScript.PrintWeaponName(gameObject.name); });
        pEventTrigger.triggers.Add(tPrintWeaponName);

        EventTrigger.Entry tClearText = new EventTrigger.Entry();
        tClearText.eventID = EventTriggerType.PointerExit;
        tClearText.callback.AddListener(delegate { pInventoryScript.PrintWeaponName(""); });
        pEventTrigger.triggers.Add(tClearText);
    }
Example #5
0
 void Awake()
 {
     m_pIsSelected      = new bool[m_pSelectedPlayersGizmos.Length];
     pCharactersControl = GameObject.FindObjectOfType <CharactersControl>();
 }