コード例 #1
0
 // Use this for initialization
 void Start()
 {
     rb           = GetComponent <Rigidbody2D>();
     player       = GameObject.FindGameObjectWithTag("Player");
     monstersight = gameObject.GetComponent <MonsterSight>();
     spawnCounter = 0;
 }
コード例 #2
0
    private void Awake()
    {
        mover    = GetComponent <MonsterMovement>();
        sight    = GetComponent <MonsterSight>();
        attacker = GetComponent <MonsterAttack>();

        maxHealth      = health;
        healthBar      = transform.GetChild(0).gameObject;
        healthBarValue = healthBar.transform.GetChild(0).gameObject;
        healthBar.SetActive(false);
    }
コード例 #3
0
    // Use this for initialization
    void Start()
    {
        // Find the player and playercontroller
        player              = GameObject.FindGameObjectWithTag(Tags.playerTag);
        playerController    = player.GetComponent <PlayerController>();
        animator            = GetComponentInChildren <Animator>();
        characterController = GetComponent <CharacterController>();

        // Assign the reference to the controls and game data manager
        gameController = GameObject.FindGameObjectWithTag(Tags.gameControllerTag).GetComponent <GameController>();

        // Assign the script component references
        monsterSight    = GetComponent <MonsterSight>();
        monsterHealth   = GetComponent <MonsterHealth>();
        monsterMovement = GetComponent <MonsterMovement>();
    }
コード例 #4
0
    private void RandomSpawnMonster2(GameTile tile, int group)
    {
        Monster monster = monsterFactory.Get();

        monster.SpawnOn(tile);
        monster.MonsterID = ++Monster.TotalMonster;
        monster.Group     = group;
        monsterManager.Add(monster);
        monster.OnDestroyNotify.Attach(o =>
        {
            monsterManager.Remove((Monster)o);
        });

        MonsterSight sight = new MonsterSight(monster, this);

        monster.EnterBattleMode(sight);
    }
コード例 #5
0
 // Use this for initialization
 void Awake()
 {
     rigid    = GetComponent <Rigidbody2D>();
     animator = GetComponent <Animator>();
     sight    = gameObject.AddComponent <MonsterSight>();
 }
コード例 #6
0
ファイル: BeeBehaviour.cs プロジェクト: Lubytes/Cute-Castle
 // Use this for initialization
 void Start()
 {
     player       = GameObject.FindGameObjectWithTag("Player");
     monstersight = gameObject.GetComponent <MonsterSight>();
 }