コード例 #1
0
    // Start is called before the first frame update
    void Start()
    {
        this.GetComponent <SpriteRenderer>().sprite = _Default;
        setUpAnimators();
        Rodent r = this.GetComponent <Rodent>();

        if (r)
        {
            r.setRodentType(Rodent.eRodentType.Rat);
            r.setSpeed(_MoveSpeed);
            r.setHpMax(_HpMax);
            r.setHp(_Hp);
            r.setAttackDmg(_AttackDamage);
            r.setPortrait(_Portrait);
            r.setBuildRate(_buildRate);
            r.setGatherRate(_gatherRate);

            setUpProperBoxCollider();


            int curr = ResourceManagerScript.Instance.getCurrentPopulation();
            r.setRecruitmentCost(_RecruitmentCost + curr);
        }


        //TMP Test - Finds and follows the player
        // this.GetComponent<SubjectScript>().currentTarget = GameObject.FindObjectOfType<PlayerStats>().gameObject;
    }
コード例 #2
0
ファイル: Beaver.cs プロジェクト: kaliannee/RoyalRodentsNew
    // Start is called before the first frame update
    void Start()
    {
        this.GetComponent <SpriteRenderer>().sprite = _Default;
        setUpAnimators();
        Rodent r = this.GetComponent <Rodent>();

        if (r)
        {
            r.setRodentType(Rodent.eRodentType.Beaver);
            r.setSpeed(_MoveSpeed);
            r.setHpMax(_HpMax);
            r.setHp(_Hp);
            r.setAttackDmg(_AttackDamage);
            r.setPortrait(_Portrait);
            r.setBuildRate(_buildRate);
            r.setGatherRate(_gatherRate);
            setUpProperBoxCollider();

            int curr = ResourceManagerScript.Instance.getCurrentPopulation();
            r.setRecruitmentCost(_RecruitmentCost + curr);
        }
    }