예제 #1
0
파일: Player.cs 프로젝트: RhythNS/RunAndGun
 private void Start()
 {
     if (IsAI == false)
     {
         PlayersDict.Instance.Register(this);
     }
     EntityMaterialManager.PlaySpawnEffect();
 }
예제 #2
0
파일: Enemy.cs 프로젝트: RhythNS/RunAndGun
    /// <summary>
    /// Inits the Enemy.
    /// </summary>
    /// <param name="enemyObject">The enemy object.</param>
    /// <param name="roomBorder">The border of the room the enemy spawned in.</param>
    public void Set(EnemyObject enemyObject, Rect roomBorder)
    {
        if (IsBoss == false)
        {
            EntityMaterialManager.PlaySpawnEffect();
        }

        Brain.tree = enemyObject.BehaviourTree;

        carryingWeapons = enemyObject.Weapons;
        EquippedWeapon.Swap(enemyObject.Weapons[0]);

        Brain.BrainMover.meterPerSecond = enemyObject.Stats.metersPerSecond;
        Brain.BrainMover.RoomBounds     = roomBorder;

        Health.Init(enemyObject.Stats.maxHealth);

        entityName = enemyObject.name;
    }