コード例 #1
0
    public void init(int ageRange, Transform destination, StatCounter statCounter)
    {
        this.ageRange = ageRange;
        this.viewObject.GetComponent <Renderer>().material = ageRangeMats[ageRange];
        this.destination = destination;
        this.GetComponent <AIDestinationSetter>().target = destination;

        switch (ageRange)
        {
        case 0: { break; }

        case 1: { viewObject.transform.position += new Vector3(0, 0.06f, 0); break; }

        case 2: { viewObject.transform.position += new Vector3(0, 0.12f, 0); break; }

        case 3: { viewObject.transform.position += new Vector3(0, 0.18f, 0); break; }

        case 4: { viewObject.transform.position += new Vector3(0, -0.06f, 0); break; }

        case 5: { viewObject.transform.position += new Vector3(0, -0.12f, 0); break; }
        }

        statCounter.addAgent(ageRange);
    }