コード例 #1
0
ファイル: Moster.cs プロジェクト: mengtest/Action-Game
 void Start()
 {
     player   = GameObject.FindGameObjectWithTag(Tags.player).transform;
     pad      = player.GetComponent <PlayerAttackDamage>();
     cc       = GetComponent <CharacterController>();
     animator = GetComponent <Animator>();
 }
コード例 #2
0
 private void Start()
 {
     attackTable = Resources.Load <PlayerAttackDamage>("Data/CharacterStatusData");
     ADlist      = attackTable.AttackDataList;
     animator    = transform.root.GetComponent <Animator>();
     player      = GameObject.Find("Player");
 }
コード例 #3
0
ファイル: enemyhitbox.cs プロジェクト: AGGP-NHTI/Vibin
    void OnTriggerEnter2D(Collider2D collider)
    {
        PlayerPawn             playerPawn = collider.GetComponent(typeof(PlayerPawn)) as PlayerPawn;
        PlayerAttackDamageLeft PL         = collider.GetComponent(typeof(PlayerAttackDamageLeft)) as PlayerAttackDamageLeft;
        PlayerAttackDamage     PR         = collider.GetComponent(typeof(PlayerAttackDamage)) as PlayerAttackDamage;

        if (playerPawn != null)
        {
            hit = true;
            if (damaging)
            {
                playerPawn.Damage(baseEnemy.gameObject.transform.right);
            }
        }
        else if (PL != null)
        {
        }
        else if (PR != null)
        {
        }
        else
        {
            bash = true;
        }
    }
コード例 #4
0
    void OnTriggerEnter2D(Collider2D collider)
    {
        PlayerPawn             playerPawn = collider.GetComponent(typeof(PlayerPawn)) as PlayerPawn;
        PlayerAttackDamageLeft PL         = collider.GetComponent(typeof(PlayerAttackDamageLeft)) as PlayerAttackDamageLeft;
        PlayerAttackDamage     PR         = collider.GetComponent(typeof(PlayerAttackDamage)) as PlayerAttackDamage;

        if (playerPawn != null)
        {
            playerPawn.Damage(gameObject.transform.right);
            if (!penetrate)
            {
                if (explosive)
                {
                    GameObject clone;
                    clone = Instantiate(boom, gameObject.transform.position, gameObject.transform.rotation);
                }
                Destroy(gameObject);
            }
        }
        if (PL != null || PR != null)
        {
            if (destructable)
            {
                Destroy(gameObject);
                if (explosive)
                {
                    GameObject clone;
                    clone = Instantiate(boom, gameObject.transform.position, gameObject.transform.rotation);
                }
            }
        }
    }
コード例 #5
0
 void SetInitialReferences()
 {
     playerattackDamage  = GetComponent <PlayerAttackDamage>();
     player_Master       = GetComponent <Player_Master>();
     judgement_StatusNum = 0;
 }