Exemplo n.º 1
0
 void Awake()
 {
     eventSystem        = GameObject.Find("EventSystem");
     rotationGizmo      = GameObject.Find("RotationGizmo");
     rotationScript     = rotationGizmo.GetComponent <RotationGizmo>();
     selectPart         = eventSystem.GetComponent <SelectPart>();
     fuseEvent          = eventSystem.GetComponent <FuseEvent>();
     conversationSystem = GameObject.Find("ConversationSystem");
 }
Exemplo n.º 2
0
    /// <summary>
    /// Handles the Fuse movement
    /// Sets the Animator to enter the InInteractable state
    /// </summary>
    public void CollideFusePoint()
    {
        FuseEvent.RemoveListener(CollideFusePoint);
        UpcomingFusePoint.GetComponent <StartPoint>().StartFollowingFuse();
        IsInvulnerable = true;

        // Update Animator
        _anim.EnterInteractable(InteractibleObject.InteractType.Fuse);

        // Notify Sally
        _salamanderController?.AddTarget(EventType.EnterFuse, transform.position);
    }
Exemplo n.º 3
0
    // Use this for initialization
    void Start()
    {
        triggersFinished = new bool[NUM_TRIGGERS];
        for (int i = 0; i < NUM_TRIGGERS; i++)
        {
            triggersFinished[i] = false;
        }

        selectPart = eventSystem.GetComponent <SelectPart>();
        fuseEvent  = eventSystem.GetComponent <FuseEvent>();
        ConversationTrigger.RemoveToken("blockTutorial2Start");
        conversationSystem = GameObject.Find("ConversationSystem");
        done = false;
    }
Exemplo n.º 4
0
    void OnEnable()
    {
        tooltipsEnabled = false;

        rotationScript    = rotationGizmo.GetComponent <RotationGizmo>();
        fuseEvent         = eventSystem.GetComponent <FuseEvent>();
        selectPart        = eventSystem.GetComponent <SelectPart>();
        cameraControls    = mainCam.GetComponent <CameraControls>();
        baseStartPosition = new Vector3(-100, 30, 100);

        fuseEvent.setIsFirstLevel(true);

        partButtons    = new Button[3];
        partButtons[0] = b1p1Button;
        partButtons[1] = b1p2Button;
        partButtons[2] = b1p3Button;

        // tooltips occur on: all part buttons, Fuse button, Finished Image, bb1 child
        allTooltips     = new Tooltip[16];
        allTooltips[0]  = b1p1Button.gameObject.GetComponent <Tooltip>();
        allTooltips[1]  = b1p2Button.gameObject.GetComponent <Tooltip>();
        allTooltips[2]  = b1p3Button.gameObject.GetComponent <Tooltip>();
        allTooltips[3]  = finishedImage.GetComponent <Tooltip>();
        allTooltips[4]  = fuseButton.gameObject.GetComponent <Tooltip>();
        allTooltips[5]  = bb1.GetComponent <Tooltip>();
        allTooltips[6]  = yUp.GetComponent <Tooltip>();
        allTooltips[7]  = yDown.GetComponent <Tooltip>();
        allTooltips[8]  = xUp.GetComponent <Tooltip>();
        allTooltips[9]  = xDown.GetComponent <Tooltip>();
        allTooltips[10] = zUp.GetComponent <Tooltip>();
        allTooltips[11] = zDown.GetComponent <Tooltip>();
        allTooltips[12] = bb1_b1p1_a1.GetComponent <Tooltip>();
        allTooltips[13] = bb1_b1p2_a1.GetComponent <Tooltip>();
        allTooltips[14] = bb1_b1p2_a2.GetComponent <Tooltip>();
        allTooltips[15] = bb1_b1p3_a1.GetComponent <Tooltip>();

        //make sure all tooltips are disabled on startup
        for (int i = 0; i < allTooltips.Length; i++)
        {
            allTooltips[i].enabled = false;
        }
    }
Exemplo n.º 5
0
    /// <summary>
    /// CoRoutine responsible for moving the Player.
    /// </summary>
    private IEnumerator MoveRoutine(Vector3 target, float duration)
    {
        // Before Movement
        CanAttachToPlane = true;

        _moveTweener?.Kill();

        UpdateFireAmount(IsDashing ? DashCostInPercentage : MoveCostInPercentage);

        TargetPosition = target;
        IsMoving       = true;

        CheckCollision();

        _moveTweener = _rigidBody.DOMove(TargetPosition, duration);
        _moveTweener.SetEase(IsDashing ? DashEase : MoveEase);


        yield return(new WaitForSeconds(duration * planeAttachTime));

        CanAttachToPlane = false;

        yield return(new WaitForSeconds(duration * (1 - planeAttachTime)));

        // After Movement
        CheckFireLeft();
        AudioEvent.SendAudioEvent(AudioEvent.AudioEventType.DashEnded, _audioEvents, gameObject);

        IsMoving  = false;
        IsDashing = false;

        HealthPercentage.Value = _currentFireAmount;
        UpdateGoalDistances();

        // Notify Sally
        _salamanderController?.AddTarget(EventType.Move, transform.position);

        _rigidBody.velocity = Vector3.zero;
        FuseEvent.Invoke();
    }
Exemplo n.º 6
0
    // Use this for initialization
    void Start()
    {
        triggersFinished = new bool[NUM_TRIGGERS];
        for (int i = 0; i < NUM_TRIGGERS; i++)
        {
            triggersFinished[i] = false;
        }

        rotationScript     = rotationGizmo.GetComponent <RotationGizmo>();
        fuseEvent          = eventSystem.GetComponent <FuseEvent>();
        selectPart         = eventSystem.GetComponent <SelectPart>();
        partButtonClicked  = false;
        conversationSystem = GameObject.Find("ConversationSystem");
        done = false;

        //disable part buttons so player can't use them while Dresha talks
        foreach (Button b in partButtons)
        {
            b.interactable = false;
        }
        //disable clicking on black regions while Dresha talks
        //could throw error if any of the objects in attachments do not have a MeshCollider or BoxCollider
        foreach (GameObject a in attachments)
        {
            BoxCollider bcollide = a.GetComponent <BoxCollider>();
            if (bcollide == null)
            {
                a.GetComponent <MeshCollider>().enabled = false;
            }
            else
            {
                bcollide.enabled = false;
            }
        }
        SimpleData.WriteStringToFile("LeapData.txt", "***This is another try at " + DateTime.Now.ToString() + ".");
        LeapStatic.resetConstructionObject("tutorial1");
    }