safeFadeTo() 공개 정적인 메소드

public static safeFadeTo ( GameObject toFade, Hashtable fadeOptions ) : void
toFade GameObject
fadeOptions Hashtable
리턴 void
예제 #1
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);
    }