protected ParticleSystem InstatiateParticle(ParticleSystem toInstantiate, GameObject point, bool isToParent = false, float destroyTimer = 1f, bool isFollow = false, bool keepRotation = false)
    {
        ParticleSystem ret = null;

        if (toInstantiate != null)
        {
            ret = Instantiate(toInstantiate, point.transform.position, point.transform.rotation) as ParticleSystem;
            if (keepRotation)
            {
                ret.transform.rotation = toInstantiate.transform.rotation;
            }
            ret.Play();
            Destroy(ret.gameObject, destroyTimer);
            if (isToParent)
            {
                ret.transform.SetParent(point.transform);
            }
            if (isFollow)
            {
                FollowTheLeader follower = ret.GetComponent <FollowTheLeader>();
                if (follower == null)
                {
                    Debug.LogError(ret.gameObject.name + " cannot find FollowTheLeader script did you forget to put it on the particle system?");
                }
                else
                {
                    if (point == null)
                    {
                        Debug.LogError(ret.gameObject.name + " doesnt have a point to follow, did you forget to send it?");
                    }
                    else
                    {
                        follower._toFollow = point;
                    }
                }
            }
        }
        else
        {
            Debug.LogWarning("Missing Particle");
        }

        return(ret);
    }
Exemplo n.º 2
0
 void Start()
 {
     FollowTheLeaderScript = minigame.GetComponent<FollowTheLeader> ();
 }
Exemplo n.º 3
0
    void Start()
    {
        Instance = this;

        //changing these to the background sprite to attempt to access their color directly, if it doesn't work,
        //change it back to "MoveRightHandButton" etc.
        userButtons [(int)eType.RIGHT] = new PlayerSprite ("MoveRightHandButton");
        userButtons [(int)eType.LEFT] = new PlayerSprite ("MoveLeftHandButton");
        userButtons [(int)eType.CLAP] = new PlayerSprite ("MoveClapHandButton");
        UpdatePlayerTextures();

        tutorialHand = GameObject.Find("TutorialHand");
        tutorialHand.SetActive(false);

        Sherlock.Instance.SetBubblePosition (Sherlock.side.DOWN);

        // Find assocciated minigame
        minigame = GetComponent<Minigame> ();

        Sherlock.Instance.HideDialogue();

        if(!minigame.isStandalone()) //if the minigame is part of the story, not free play mode
        {
            Destroy(tutorialOptions);
            showTutorial = true;

            // Show the instructions of the minigame
            if (minigame != null && minigame.StartConversation () == false) {
                Debug.Log (minigame.conversationTree.root);
            }

            Invoke("continueDialogue", minigame.GetCurrentDialogueDuration());
            leftLabelOffset = instructionLabelOffset;
            rightLabelOffset = instructionLabelOffset;
            rightLabelOffset.x = -rightLabelOffset.x;

            SetHandColliders(false);
        }
        //noTutorial();
    }