Ejemplo n.º 1
0
    void                                            SkinMutation()
    {
        PlantSkin bestSkin = this.defaultSkin;

        for (int i = 0; i < this.upgradeSkins.Length; ++i)
        {
            if (this.upgradeSkins[i].minLength <this.currentSize && this.upgradeSkins[i].minLength> bestSkin.minLength)
            {
                bestSkin = this.upgradeSkins[i];
            }
        }
        this.skin = bestSkin;
    }
Ejemplo n.º 2
0
    void                                            Awake()
    {
        int controlledNodes = this.controlledNodes;
        int oldCurrentSize  = this.currentSize;

        this.audioSource = this.GetComponent <AudioSource>();
        this.skin        = this.defaultSkin;
        this.currentSize = 0;
        this.joints.Add((this.head = this.GetComponentInChildren <HingeJoint2D>()));
        for (int i = 0; i < oldCurrentSize; ++i)
        {
            AddNode();
        }
        this.controlledNodes = controlledNodes; // to modify
        this.targetForce     = new Vector3(this.powerDistribution.Evaluate(0.33f), this.powerDistribution.Evaluate(0.66f), this.powerDistribution.Evaluate(1));
    }