Exemplo n.º 1
0
    void PulseSegment(GameObject segment)
    {
        BrightFadeInGeneric fader = segment.GetComponent <BrightFadeInGeneric>();

        if (fader.enabled == false)
        {
            fader.enabled = true;
        }
    }
Exemplo n.º 2
0
    public override void ServerAndClientJoinedGame()
    {
        base.ServerAndClientJoinedGame();

        gameUnitState.SetTransforms(gameUnitState.transform, transform);

        if (typeof(ITurretedUnitState).IsAssignableFrom(gameUnitState.GetType()))
        {
            var s = entity.GetState <ITurretedUnitState>();
            //TODO: this won't work for more than 1 weapon
            foreach (var weapon in Weapons())
            {
                if (weapon.turretObjX != null)
                {
                    s.SetTransforms(s.turretXTransform, weapon.turretObjX.transform);
                }

                if (weapon.turretObjY != null)
                {
                    s.SetTransforms(s.turretYTransform, weapon.turretObjY.transform);
                }
            }
        }

        playerCommands = new List <Bolt.Event>();

        SetupWeapons();
        SetupSmokeDamage();
        SetupDeathExplosion();

        if (player != null)
        {
            if (shouldAddToPlayerUnits)
            {
                player.units.Add(this);
            }

            if (isPlayerPainted)
            {
                //App.shared.Log("player.Paint()", this);
                player.Paint(gameObject);
            }
        }

        PlayBirthSound();
        PlayRunningSound();

        if (fadeInPeriod != 0f)
        {
            //BrightFadeIn comp = gameObject.AddComponent<BrightFadeIn>();
            BrightFadeInGeneric comp = gameObject.AddComponent <BrightFadeInGeneric>();
            comp.period = fadeInPeriod;
        }

        serverAndClientJoinedGame = true;

        if (veteranLevel > 0)
        {
            ShowVeteranLevel();
        }
    }