예제 #1
0
 void LateUpdate()
 {
     if (_unit_ID.IsReady())
     {
         initalize();
     }
 }
예제 #2
0
    void Update()
    {
        _smoke.SetActive(ISActive);

        switch (spawnedCharacter)
        {
        case MinionType.Ghost:
            _smoke.transform.position = _spawnPointGhost.transform.position;
            break;

        case MinionType.Warrior:
            _smoke.transform.position = _spawnPointWarrior.transform.position;
            break;

        case MinionType.Wizard:
            _smoke.transform.position = _spawnPointWizard.transform.position;
            break;

        default:
            break;
        }

        if (IsInit || !_unitId.IsReady())
        {
            return;
        }

        IsInit = true;
        _spawnPointGhost.GetComponent <Renderer>().material.mainTexture   = _texturesSpawnColorGhost[_unitId.GetPlayerIndex() - 1];
        _spawnPointWarrior.GetComponent <Renderer>().material.mainTexture = _texturesSpawnColorWarrior[_unitId.GetPlayerIndex() - 1];
        _spawnPointWizard.GetComponent <Renderer>().material.mainTexture  = _texturesSpawnColorWizard[_unitId.GetPlayerIndex() - 1];
        _portal.GetComponent <Renderer>().material.mainTexture            = _texturesSpawnColorPortal[_unitId.GetPlayerIndex() - 1];
    }
예제 #3
0
    void Update()
    {
        if (IsInit || !unitID.IsReady())
        {
            return;
        }
        IsInit = true;

        GameObject player = GameSharedData.GetLocalPlayer();

        // don't do it for other players

        /*    if (player.GetComponent<Unit_ID>().GetPlayerIndex() != GetComponent<Unit_ID>().GetPlayerIndex())
         *  {
         *      enabled = false;
         *      return;
         *  }*/

        Swipeable swipeable = GetComponent <Swipeable>();

        swipeable.onSwipe   = OnSwipe;
        swipeable.onTouched = OnTouched;
    }