コード例 #1
0
    //    public ParticleSystem hitEffect;
    #endregion

    protected virtual void Awake()
    {
        isDead       = false;
        stateManager = GetComponent <StateManager>();
        if (stateManager == null)
        {
            Debug.LogError(gameObject.ToString() + ": No state manager found!");
        }
        moveBody = this.GetComponent <MoveBodyScript>();
        if (moveBody == null)
        {
            Debug.LogError(gameObject.ToString() + ": No move body script found!");
        }
        if (hitEffect != null)
        {
            hitEffects = hitEffect.GetComponentsInChildren <ParticleSystem>();
            for (int i = 0; i < hitEffect.transform.childCount; i++)
            {
                if (hitEffect.transform.GetChild(i).CompareTag("permanentBlood"))
                {
                    hitEffectPermanent = hitEffect.transform.GetChild(i).gameObject;
                    break;
                }
            }
        }
    }
コード例 #2
0
    //    public ParticleSystem hitEffect;
    #endregion

    protected virtual void Awake()
    {
        stateManager = GetComponent <StateManager>();
        if (stateManager == null)
        {
            Debug.LogError(gameObject.ToString() + ": No state manager found!");
        }
        moveBody = this.GetComponent <MoveBodyScript>();
        if (moveBody == null)
        {
            Debug.LogError(gameObject.ToString() + ": No move body script found!");
        }
    }
コード例 #3
0
 void Awake()
 {
     stateManager = this.GetComponent <StateManager>();
     if (stateManager == null)
     {
         Debug.LogError(gameObject.ToString() + ": No state manager found!");
     }
     moveBody = this.GetComponent <MoveBodyScript>();
     if (moveBody == null)
     {
         Debug.LogError(gameObject.ToString() + ": No move body script found!");
     }
     // Tells the game manager that this is the player, so AI scripts can more easily find the player.
     GameManager.SetPlayer(this.gameObject);
 }