Beispiel #1
0
    public void spawnSpirit()
    {
        SpiritMovement SpiritClone = Instantiate(Spirit);

        SpiritClone.transform.position = Spawnloc.transform.position;

        SpiritClone.gameObject.SetActive(true);
    }
Beispiel #2
0
 void Start()
 {
     fadeBlack = GameObject.Find ("BlackFade");
     anim = GetComponentInChildren<Animator>();
     charGfx = anim.gameObject.transform;
     sMove = GameObject.FindObjectOfType<SpiritMovement>();
     pMove = GetComponent<PlayerMovement>();
     pSwitch = GetComponent<PlayerSwitch>();
     actionHandler =  GetComponent<ActionHandler>();
     if(actionHandler)
     {
         actionHandler.TakeAction += End;
     }
     //		StartCoroutine("EndCR");
 }
Beispiel #3
0
    void Start()
    {
        if(Camera.main.GetComponent<AudioReverbZone>())
        {
            reverbZone = Camera.main.GetComponent<AudioReverbZone>();
        }
        spiritParticlesR = Camera.main.GetComponentInChildren<ParticleSystemRenderer>();
        sPRColorStart = spiritParticlesR.material.GetColor("_TintColor");
        spiritParticlesR.material.SetColor("_TintColor", new Color(sPRColorStart.r, sPRColorStart.g, sPRColorStart.b, 0));
        //		RenderSettings.ambientLight = new Color(1,1,1);
        startAmbientL = RenderSettings.ambientLight;
        spiritObj = GameObject.Find("Spirit");
        playerController = playerObj.GetComponent<CharacterController>();
        playerVelocity = playerController.velocity;
        playerMove = playerObj.GetComponent<PlayerMovement>();

        spiritMove = spiritObj.GetComponent<SpiritMovement>();
        spiritGfx = spiritObj.transform.GetChild(0).gameObject;
        spiritGfxMesh = spiritGfx.transform.GetChild(0).gameObject;

        spiritMove.activeMovement = false;
        //		spiritObj.renderer.enabled = false;
        spiritObj.GetComponent<Collider>().enabled = false;
        spiritGfx.SetActive(false);
        charMesh = transform.GetChild(0).transform.GetChild(0);
        dir = -1;
        switchable =true;
    }
Beispiel #4
0
    // Use this for initialization
    //    private List<GameObject> children;
    //    private int i = 0;
    void Start()
    {
        //		foreach( GameObject gObj in transform)
        //		{
        //			children[i] = gObj;
        //			i++;
        //		}

        startColor = this.GetComponent<Renderer>().material.GetColor("_TintColor");

        sMove = GameObject.Find("Spirit").GetComponent<SpiritMovement>();
        playerSwitch = GameObject.FindObjectOfType<PlayerSwitch>();
        if(!sMove.grounded)
        {
            StartCoroutine("FadeOut");
            fadedIn =	true;
        }
        this.GetComponent<Renderer>().material.SetColor("_TintColor", new Color(startColor.r, startColor.g, startColor.b, 0));
    }