コード例 #1
0
ファイル: Apple.cs プロジェクト: maftkd/SeedSurvival
 // Start is called before the first frame update
 void Start()
 {
     mMan        = GameObject.FindGameObjectWithTag("Player").transform.GetChild(0).GetComponent <MeditationManager>();
     appleParent = GameObject.FindGameObjectWithTag("AppleParent").transform;
     myMat       = transform.GetComponent <MeshRenderer>().material;
     StartCoroutine(Grow());
 }
コード例 #2
0
ファイル: FruitTree.cs プロジェクト: maftkd/SeedSurvival
    // Start is called before the first frame update
    void Start()
    {
        mMan     = GameObject.FindGameObjectWithTag("Player").transform.GetChild(0).GetComponent <MeditationManager>();
        dayCycle = GameObject.FindGameObjectWithTag("Sun").GetComponent <DayCycle>();

        if (!loaded)
        {
            liveBranchPositions = new List <Vector3>();
            allBranchPositions  = new List <Vector3>();
            liveBranchRotations = new List <Quaternion>();
            allBranchRotations  = new List <Quaternion>();
            allBranchScales     = new List <Vector3>();
            //debugText.text = "Planted";

            StartCoroutine(BreakSurface());
        }
        else
        {
            //do stuff

            if (allBranchPositions.Count < 1)
            {
                liveBranchPositions.Clear();
                liveBranchRotations.Clear();
                StartCoroutine(BreakSurface());
            }
            else
            {
                for (int i = 0; i < allBranchPositions.Count; i++)
                {
                    CreateBranchInstantly(allBranchPositions[i], allBranchRotations[i], allBranchScales[i], i != 0);
                }
                int   branchLevel = allBranchPositions.Count / branchRate + 1;
                float growTime    = branchTime * Mathf.Pow(growthRateDelay, branchLevel);
                for (int i = 0; i < oldBranchPositions.Count; i++)
                {
                    StartCoroutine(CreateBranch(growTime, oldBranchPositions[i], oldBranchRotations[i], true));
                }
            }
        }
    }
コード例 #3
0
 // Start is called before the first frame update
 void Start()
 {
     sAudio = transform.GetComponent <AudioSource>();
     mDir   = transform.GetComponent <DirectionalMovement>();
     mMan   = transform.GetComponent <MeditationManager>();
 }
コード例 #4
0
 // Start is called before the first frame update
 void Start()
 {
     mMan = GameObject.FindGameObjectWithTag("Player").transform.GetChild(0).GetComponent <MeditationManager>();
     StartCoroutine(TrackSeasons());
     seasonText.text = "Season/Day: " + seasonCode + "/" + dayCode;
 }