Inheritance: MonoBehaviour
Example #1
0
    private void setSpeed()
    {
        //SetSpeed
        float speed = _inputMovement.sqrMagnitude + 0.3f;

        //TODO put variable for this
        if (null == _swimAnimator)
        {
            _swimAnimator = (SwimAnimator)gameObject.GetComponent <SwimAnimator>();
        }
        _swimAnimator.setSpeed(speed);
    }
Example #2
0
    public void initialize(Hero playableCell, Vector3 checkpointPosition)
    {
        //TODO find systematic way of doing this

        Destroy(GetComponent <Hero>());
        Destroy(GetComponent <CellControl>());
        Destroy(GetComponent <PhysicalMedium>());
        Destroy(GetComponent <PhenoSpeed>());
        Destroy(GetComponent <PhenoLight>());
        Destroy(GetComponent <PhenoToxic>());
        Destroy(GetComponent <PhenoFickContact>());
        Destroy(GetComponent <BlackLight>());
        Destroy(GetComponent <Rigidbody>());

        SphereCollider[] colliders = GetComponentsInChildren <SphereCollider>();
        for (int i = 0; i < colliders.Length; i++)
        {
            if (colliders[i].gameObject.name == "PhenoLight")
            {
                colliders[i].enabled = false;
            }
        }

        resetCollisionState();

        SwimAnimator newCellSwimAnimator = (SwimAnimator)GetComponent <SwimAnimator>();

        newCellSwimAnimator.setSpeed(_waitAnimationSpeed);

        transform.position   = playableCell.transform.position;
        transform.localScale = playableCell.transform.localScale;

        //TODO set slow animation
        //TODO change appearance to make it different from playable bacterium: maybe remove eyes?
        //TODO put animation when bacterium becomes playable, then divide cell
        Hero.safeFadeTo(gameObject, _optionsDuplicatedAlpha);
    }
Example #3
0
 private void setSpeed()
 {
     //SetSpeed
     float speed = _inputMovement.sqrMagnitude + 0.3f;
     //TODO put variable for this
     if(null == _swimAnimator)
     {
     _swimAnimator = (SwimAnimator)gameObject.GetComponent<SwimAnimator>();
     }
     _swimAnimator.setSpeed(speed);
 }