コード例 #1
0
ファイル: Donka.cs プロジェクト: DanStout/FablesOfSol
    void Start()
    {
        chaser = GetComponent<ChasesPlayer>();
        hurt = GetComponent<Hurtable>();
        faces = GetComponent<FacesPlayer>();
        drops = GetComponent<DropsItems>();
        attacks = GetComponent<AttacksPlayer>();
        anim = GetComponent<Animator>();

        hurt.onDeath += hurt_onDeath;
        hurt.onHurt += hurt_onHurt;
    }
コード例 #2
0
    void Start()
    {
        thirdPersonUserControl = GetComponent <ThirdPersonUserControl>();
        anim = GetComponent <Animator>();
        GetComponent <PlayerHud>().SetBars();
        ap = GetComponent <AttacksPlayer>();

        StartCoroutine("RegMana");
        StartCoroutine("RegHealth");

        PauseMenu.IsOn      = false;
        PauseMenu.IsLoading = false;

        PlayerData data = SaveSystem.LoadPlayer();

        if (data != null)
        {
            currentHealth      = data.health;
            currentMana        = data.mana;
            transform.position = new Vector3(data.position[0], data.position[1], data.position[2]);


            GameObject npcs_quests = GameObject.Find("NPCS_QUESTS");
            NpcQuest[] quests      = npcs_quests.GetComponentsInChildren <NpcQuest>();
            int        i           = 0;
            foreach (NpcQuest quest in quests)
            {
                quest.transform.position = new Vector3(float.Parse(data.npc[i, 0]), float.Parse(data.npc[i, 1]), float.Parse(data.npc[i, 2]));
                quest.SetColorOfHalo(data.npc[i, 3]);
                quest.gameObject.SetActive(bool.Parse(data.npc[i, 4]));

                i++;
            }

            GameObject  quest_items = GameObject.Find("QuestItems");
            Transform[] qitems      = quest_items.GetComponentsInChildren <Transform>();
            i = 0;
            foreach (Transform q_item in qitems)
            {
                q_item.gameObject.SetActive(bool.Parse(data.qst[i, 0]));

                i++;
            }
        }

        cam.transform.SetParent(null);
        cam.SetActive(true);
    }
コード例 #3
0
ファイル: Iceman.cs プロジェクト: DanStout/FablesOfSol
    void Start()
    {
        anim = GetComponent<Animator>();
        dropper = GetComponent<DropsItems>();
        chaser = GetComponent<ChasesPlayer>();
        faces = GetComponent<FacesPlayer>();
        audSrc = GetComponent<AudioSource>();
        attacks = GetComponent<AttacksPlayer>();

        attacks.onPlayerHit += attacks_onPlayerHit;

        hurt = GetComponent<Hurtable>();
        hurt.onDeath += hurt_onDeath;

        hurt.onHurt += hurt_onHurt;

        tag = "enemy"; //For items to detect and deliver damage
    }
コード例 #4
0
ファイル: Dog.cs プロジェクト: DanStout/FablesOfSol
    void Start()
    {
        anim = GetComponent<Animator>();
        dropper = GetComponent<DropsItems>();
        chaser = GetComponent<ChasesPlayer>();
        faces = GetComponent<FacesPlayer>();
        hurt = GetComponent<Hurtable>();
        hurt.onDeath += hurt_onDeath;
        hurt.onHurt += hurt_onHurt;
        audioSrc = GetComponent<AudioSource>();

        attacks = GetComponent<AttacksPlayer>();
        attacks.onPlayerDeath += attacks_onPlayerDeath;
    }
コード例 #5
0
 private void Start()
 {
     ap = GetComponentInParent <AttacksPlayer>();
 }
コード例 #6
0
ファイル: FireBall.cs プロジェクト: Julen18/TFM_UOC
 public void SetAttacksPlayers(AttacksPlayer ap)
 {
     this.ap = ap;
 }