Esempio n. 1
0
 virtual protected void OnTriggerEnter(Collider other)
 {
     if (other.CompareTag("Player"))
     {
         MainObjectSingleton.shared(MainObjectType.Player).GetComponent <LevController>().StartCoroutine(Teleport(MainObjectSingleton.shared(MainObjectType.Player).gameObject));
     }
 }
Esempio n. 2
0
    protected void LevPlayCustomAnimation(DieCausesType causes)
    {
        LevDeathAnimationHandler lev = MainObjectSingleton.shared(MainObjectType.Player).GetComponent <LevDeathAnimationHandler>();

        lev.GetComponent <LevController> ().levInteractionController.throwPickedObject(Vector3.zero);         //drop picked object
        lev.Die(causes);
    }
    public void SnapLevPosition()
    {
        Vector3 snapPosition = new Vector3(0.0f, 2.62291f, 0.69556f);

        MainObjectSingleton.shared(MainObjectType.Player).transform.position = transform.position - snapPosition;
        MainObjectSingleton.shared(MainObjectType.Player).GetComponent <LevController>().FacingDirectionInstant = LevController.Direction.Right;
    }
Esempio n. 4
0
    void OnTriggerEnter(Collider other)
    {
        if (isTriggered)
        {
            return;
        }
        if (other.CompareTag("Player") && GameDataManager.shared().LOCAL_IsLoadOpening)
        {
            isTriggered = true;
            GameDataManager.shared().LOCAL_IsLoadOpening = false;

            if (GUIMenu.shared() != null)
            {
                GUIMenu.shared().camera.SaveCamPos();
                GUIMenu.shared().camera.SaveCamFoV();

                // Activate Opening
                GUIMenu.shared().AnimateOpening();


                GUIMenu.shared().openingMenu.OnMyuuJournal += HandleOpeningMenuStartingNewGame;
                GUIMenu.shared().openingMenu.OnStartingNewGame += HandleOpeningMenuStartingNewGame;
                GUIMenu.shared().openingMenu.OnContinueGame += HandleOpeningMenuContinueGame;
                GUIMenu.shared().openingMenu.OnMenuHighlighted += HandleOpeningMenuHighlighted;
            }

            MainObjectSingleton.shared(MainObjectType.Camera).GetComponent <Artoncode.Core.SmoothFollow>().enabled = false;
//			MainObjectSingleton.shared(MainObjectType.Camera).GetComponent<Artoncode.Core.CameraPlatformer.CameraController>().enabled = false;
            MainObjectSingleton.shared(MainObjectType.Player).GetComponent <LevController> ().setInputEnable(false);
            MainObjectSingleton.shared(MainObjectType.Player).GetComponent <LevController> ().turnToForeground();
            MainObjectSingleton.shared(MainObjectType.Player).GetComponent <LevController> ().playCustomAnimation("MAINMENU.AC_Lev_NoGauntlet_MainMenu_Idle");
        }
    }
Esempio n. 5
0
    void HandleOpeningMenuHighlighted(string menu)
    {
        string animationName = "MAINMENU.";

        switch (menu)
        {
        case "CONTINUE":
            animationName += "AC_Lev_NoGauntlet_MainMenu_Continue";
            break;

        case "NEW":
            animationName += "AC_Lev_NoGauntlet_MainMenu_NewGame";
            break;

        case "SETTING":
            animationName += "AC_Lev_NoGauntlet_MainMenu_Setting";
            break;

        case "QUIT":
            animationName += "AC_Lev_NoGauntlet_MainMenu_Exit";
            break;
        }
        if (!MainObjectSingleton.shared(MainObjectType.Player).GetComponent <LevController> ().levAnimator.GetCurrentAnimatorStateInfo(3).IsName("AC_Lev_MyuuJournal_Unlock"))
        {
            MainObjectSingleton.shared(MainObjectType.Player).GetComponent <LevController> ().playCustomAnimation(animationName);
        }
    }
Esempio n. 6
0
    void OnParticleCollision(GameObject other)
    {
        if (isTriggered)
        {
            return;
        }

        if (other.CompareTag("Player"))
        {
//			int safeLength = debrisParticle.GetSafeCollisionEventSize();
//			if(collisionEvents.Length < safeLength)
//				collisionEvents = new ParticleCollisionEvent[safeLength];
//
//			int numCollisionEvents = debrisParticle.GetCollisionEvents(other,collisionEvents);
//			print("in : " + numCollisionEvents);
//			return;


            isTriggered = true;
            if (!MainObjectSingleton.shared(MainObjectType.Player).GetComponent <LevController>().isGrounded)
            {
                MainObjectSingleton.shared(MainObjectType.Player).GetComponent <LevController>().setInputEnable(false);
                MainObjectSingleton.shared(MainObjectType.Player).GetComponent <LevController>().OnLanding += OnLanding;
            }
            else
            {
                dieTrigger.Trigger(false);
            }
        }
    }
Esempio n. 7
0
 void Naivis_OnObjectUsed(GameObject sender)
 {
     if (sender.GetComponent <Naivis>().state == false)
     {
         MainObjectSingleton.shared(MainObjectType.Player).GetComponent <LevController>().OnCustomAnimationFinished += OnCustomAnimationFinished;
     }
 }
Esempio n. 8
0
    void OnTriggerEnter(Collider col)
    {
        TorchUsable temp = col.GetComponent <TorchUsable> ();

        if (temp != null)
        {
            GetComponent <Collider> ().enabled = false;

            if (rainatar)
            {
                if (rainatar.isLevDied)
                {
                    return;
                }
                rainatar.isStillHauntingLev = false;
            }

            levC = MainObjectSingleton.shared(MainObjectType.Player).GetComponent <LevController> ();
            levC.setInputEnable(false);
            levC.stopMoving();
            levC.OnCustomAnimationFinished += ForceLevMove;

            burnedRope.GetComponentsInChildren <BurnedRopeParticle> ().ForEach(t => t.LightMyFire());
        }
    }
Esempio n. 9
0
//		public override void Awake ()

        public static SceneFader shared()
        {
            if (MainObjectSingleton.shared(MainObjectType.SceneFader) != null)
            {
                return(MainObjectSingleton.shared(MainObjectType.SceneFader).GetComponent <SceneFader>());
            }
            return(null);
        }
Esempio n. 10
0
    public void SetToLevPosition()
    {
        Vector3    levPos = MainObjectSingleton.shared(MainObjectType.Player).transform.position;
        Quaternion levRot = MainObjectSingleton.shared(MainObjectType.Player).transform.rotation;

        transform.position = levPos;
        transform.rotation = Quaternion.AngleAxis(80 + levRot.eulerAngles.y, Vector3.up);
    }
Esempio n. 11
0
 public void MyuuHighlight()
 {
     if (myuuModelBase.myuuAnim.GetCurrentAnimatorStateInfo(0).IsName("AUI_MyuuJournal_Idle"))
     {
         int highlightState = Animator.StringToHash("AUI_MyuuJournal_Highlight");
         myuuModelBase.myuuAnim.Play(highlightState);
         MainObjectSingleton.shared(MainObjectType.Player).GetComponent <LevController> ().playCustomAnimation("MAINMENU.AC_Lev_MyuuJournal_Highlight");
     }
 }
Esempio n. 12
0
 protected virtual void CameraStartFocusOnLev()
 {
     MainObjectSingleton.shared(MainObjectType.Camera).GetComponent <Artoncode.Core.SmoothFollow>().enabled        = true;
     MainObjectSingleton.shared(MainObjectType.Camera).GetComponent <Artoncode.Core.SmoothFollow>().target         = MainObjectSingleton.shared(MainObjectType.Player).gameObject.transform;
     MainObjectSingleton.shared(MainObjectType.Camera).GetComponent <Artoncode.Core.SmoothFollow>().positionOffset = camPosOffset;
     MainObjectSingleton.shared(MainObjectType.Camera).GetComponent <Artoncode.Core.SmoothFollow>().lookAtOffset   = camLookAtOffset;
     MainObjectSingleton.shared(MainObjectType.Camera).GetComponent <Artoncode.Core.SmoothFollow>().smoothTime     = camTransition;
     MainObjectSingleton.shared(MainObjectType.Camera).GetComponent <Artoncode.Core.SmoothFollow>().IsLocked       = true;
 }
Esempio n. 13
0
    void HandlePausedMenuResumeGame()
    {
        ClearEvents();
        Time.timeScale = 1f;
        GUIMenu.shared().pausedMenu.OnOutroEnd += EnableMainMenu;
        MainObjectSingleton.shared(MainObjectType.Camera).GetComponent <Artoncode.Core.SmoothFollow> ().enabled = true;
//		GUIMenu.shared().camera.MoveCamFoV(GUICamZoom.Original,0.25f,0f,null);
//		GUIMenu.shared().camera.MoveCamPos(GUICamPos.Original,0.25f,0f,null);
    }
Esempio n. 14
0
    void OnTriggerEnter(Collider col)
    {
        LevController levC = MainObjectSingleton.shared(MainObjectType.Player).GetComponent <LevController> ();

        if (col.CompareTag("Player") && levC.GetComponentInChildren <TorchUsable>() == null)
        {
            levC.lookBack();
            StartCoroutine(StopLookback(levC));
        }
    }
Esempio n. 15
0
 void NewYes()
 {
     dialogMenu.OnOutroEnd -= NewYes;
     MainObjectSingleton.shared(MainObjectType.Camera).GetComponent <Artoncode.Core.SmoothFollow> ().enabled = false;
     if (dialogMenu.selectionYes)
     {
         Vector3 newPos = Camera.main.transform.position + deltaCamPos;
         MoveCam(newPos);
         OnFinishCamMove += AfterNew;
     }
 }
Esempio n. 16
0
 void OnTriggerEnter(Collider other)
 {
     if (isTriggered)
     {
         return;
     }
     if (other.CompareTag("Player"))
     {
         isTriggered = true;
         MainObjectSingleton.shared(MainObjectType.Camera).GetComponent <AmplifyColorEffect>().BlendTo(amplifyBlendTexture, duration, null);
     }
 }
Esempio n. 17
0
 void OnTriggerEnter(Collider other)
 {
     if (other.CompareTag("Player") && isPortalOnTriggerEnter)
     {
         if (!isPortalling)
         {
             MainObjectSingleton.shared(MainObjectType.Player).GetComponent <LevController>().stopMoving();
             MainObjectSingleton.shared(MainObjectType.Player).GetComponent <LevController>().setInputEnable(false);
             Portal();
         }
     }
 }
Esempio n. 18
0
    public void MyuuClicked(string sth)
    {
        myuuButton.SetActive(false);
        int pressedState = Animator.StringToHash(sth);

        myuuModelBase.myuuAnim.Play(pressedState);
        if (sth == "AUI_MyuuJournal_Select1")
        {
            MainObjectSingleton.shared(MainObjectType.Player).GetComponent <LevController> ().playCustomAnimation("MAINMENU.AC_Lev_MyuuJournal_Select");
        }
        myuuModelBase.OnFinishExit += MyuuJournalHide;
    }
Esempio n. 19
0
    void OnTriggerEnter(Collider other)
    {
        LevController levC = MainObjectSingleton.shared(MainObjectType.Player).GetComponent <LevController> ();

        if (other.CompareTag("Player") && levC.GetComponentInChildren <TorchUsable>() != null)
        {
            levC.lookBack();
            StartCoroutine(StopLookback(levC));
//			startY = plank.transform.position.y;
//			CreateItween ();
        }
    }
Esempio n. 20
0
    protected override void GameoverCameraObject_OnBlackoutEnded(GameObject sender)
    {
        gameoverCameraObject.OnBlackoutEnded -= GameoverCameraObject_OnBlackoutEnded;
        CreateEmptyPlane();
        MainObjectSingleton.shared(MainObjectType.Player).GetComponent <Rigidbody> ().isKinematic = true;
        LevPlayCustomAnimation(causes);
        MainObjectSingleton.shared(MainObjectType.Player).transform.position = this.gameObject.transform.position;
        MainObjectSingleton.shared(MainObjectType.Player).GetComponent <LevController> ().FacingDirectionInstant = LevController.Direction.Right;
        CameraStartFocusOnLev();

        gameoverCameraObject.OnTextComesOutEnded += GameoverCameraObject_OnTextComesOutEnded;
        sender.GetComponent <GameoverCameraManager> ().ShowText(dieLastWord);
    }
Esempio n. 21
0
    IEnumerator Start()
    {
        while (!lev)
        {
            if (MainObjectSingleton.shared(MainObjectType.Player) != null)
            {
                lev = MainObjectSingleton.shared(MainObjectType.Player).gameObject;
            }
            yield return(null);
        }

        cinematicCaller.OnMovieStart += HandlerCinematicCaller_OnMovieStart;
    }
Esempio n. 22
0
 public void StartIntro()
 {
     if (GameDataManager.shared().MyuuJournalState != MyuuJournalState.None)
     {
         SetToLevPosition();
         gameObject.SetActive(true);
         myuuButton.SetActive(false);
         myuuModelBase.OnFinishIntro += FinishIntro;
         if (GameDataManager.shared().MyuuJournalState == MyuuJournalState.First)
         {
             int unlockState = Animator.StringToHash("AUI_MyuuJournal_Unlock");
             myuuModelBase.myuuAnim.Play(unlockState);
             MainObjectSingleton.shared(MainObjectType.Player).GetComponent <LevController> ().playCustomAnimation("MAINMENU.AC_Lev_MyuuJournal_Unlock");
         }
     }
 }
Esempio n. 23
0
    protected override void OnTriggerEnter(Collider other)
    {
        if (isTriggered)
        {
            return;
        }

        if (other.CompareTag("Player"))
        {
            if (MainObjectSingleton.shared(MainObjectType.Player).GetComponent <LevController>().isGrounded)
            {
                return;
            }
            isTriggered = true;
            Trigger();
        }
    }
Esempio n. 24
0
    void Naivis_OnLightTurnedOn()
    {
        //		holdTime = 1.0f;
        //		targetScale = activatedScale;
        if (naivis.TURNON_MODE)
        {
            return;
        }
        MainObjectSingleton.shared(MainObjectType.Player).GetComponent <LevController>().setInputEnable(true);

        if (usablePocaPetal.pocaPetal.index != 0)
        {
//			naivis.isLocked = true;
//			naivis.isAccessible  = false;
//			usablePocaPetal.isAccessible = false;
            cutscene.Play();
        }
    }
Esempio n. 25
0
    void HandleOpeningMenuContinueGame()
    {
        ClearEvents();
        MainObjectSingleton.shared(MainObjectType.Camera).GetComponent <Artoncode.Core.SmoothFollow>().enabled = true;
//		MainObjectSingleton.shared(MainObjectType.Camera).GetComponent<Artoncode.Core.CameraPlatformer.CameraController>().enabled = true;
        MainObjectSingleton.shared(MainObjectType.Player).GetComponent <LevController> ().setInputEnable(true);
        MainObjectSingleton.shared(MainObjectType.Player).GetComponent <LevController> ().levAnimator.SetTrigger("doneMainmenu");
        if (MainObjectSingleton.shared(MainObjectType.Player).GetComponent <LevController> ().levAnimator.GetCurrentAnimatorStateInfo(3).IsName("AC_Lev_MyuuJournal_Unlock"))
        {
            MainObjectSingleton.shared(MainObjectType.Player).GetComponent <LevController> ().playCustomAnimation("MAINMENU.AC_Lev_NoGauntlet_MainMenu_Idle");
        }

        if (GUIMenu.shared() != null)
        {
            GUIMenu.shared().isIdle = true;
            GUIMenu.shared().camera.MoveCamFoV(GUICamZoom.Original, 0.3f, 0f, null);
        }

        audio.PlayLevelBGM();
    }
Esempio n. 26
0
    void Update()
    {
        if (Input.GetKeyUp(KeyCode.Escape))
        {
            if ((GUIMenu.shared().isAccessible) && (GUIMenu.shared().isIdle) && (!DieTrigger.isPlayerDead))
            {
                if (GUIMenu.shared().myuuMenu)
                {
                    Time.timeScale = 0f;
                    GUIMenu.shared().OpenMyuuPausedMenu();
                    GUIMenu.shared().myuuPausedMenu.OnGoMainMenu += HandlePausedMenuMainMenu;
                    GUIMenu.shared().myuuPausedMenu.OnResume += HandleMyuuPausedMenuResume;
                }
                else
                {
                    Time.timeScale = 0f;
                    GUIMenu.shared().OpenPausedMenu();
                    GUIMenu.shared().pausedMenu.OnGoMainMenu += HandlePausedMenuMainMenu;
                    GUIMenu.shared().pausedMenu.OnResumeGame += HandlePausedMenuResumeGame;

                    GUIMenu.shared().camera.SaveCamPos();
                    GUIMenu.shared().camera.SaveCamFoV();

//					GUIMenu.shared().camera.MoveCamFoV(GUICamZoom.In,0.25f,0f,null);
//					GUIMenu.shared().camera.MoveCamPos(GUICamPos.Center,0.25f,0f,null);

                    MainObjectSingleton.shared(MainObjectType.Camera).GetComponent <Artoncode.Core.SmoothFollow> ().enabled = false;
//					MainObjectSingleton.shared (MainObjectType.Player).GetComponent<LevController> ().setInputEnable (false);
//					MainObjectSingleton.shared (MainObjectType.Player).GetComponent<LevController> ().stopMoving();
                }
            }
            else if (GUIMenu.shared().menuStack.Count > 0)
            {
                GUIMenu.shared().menuStack[GUIMenu.shared().menuStack.Count - 1].EscapeAction();
            }
            else if (GUIMenu.shared().openingLogo.openingRun)
            {
                GUIMenu.shared().openingLogo.FinishOpeningRun();
            }
        }
    }
Esempio n. 27
0
    void Start()
    {
        //ONLY SPAWN LEV WHEN NO OBJECT WITH TAG PLAYER
        if (MainObjectSingleton.shared(MainObjectType.Player) != null)
        {
            return;
        }

        LocationModel levSpawnPosition = GetLevSpawnPosition();
        Transform     atTransform      = sController.GetSpawnPosition(levSpawnPosition.location);


        // if location == start.. AUTO SET CAMERA WILL BE FORCED.
        if (levSpawnPosition.location == LocationType.Start)
        {
            autoSetCameraOnArrived = true;
        }

        lev = SpawnLev(atTransform).GetComponent <LevController>();
        ApplySetting();
    }
Esempio n. 28
0
    public void PlayMovie()
    {
        if (GUIMenu.shared() != null)
        {
            GUIMenu.shared().isAccessible = false;
        }

        movie.Play();
        movie.SetVolume(GameDataManager.shared().CONFIG_Volume / 100.0f * audioVolume);
        StartCoroutine(FadeAlpha());

        movie.OnEnd += MovieFinish;

        MainObjectSingleton.shared(MainObjectType.Player).GetComponent <LevController> ().setInputEnable(false);
        MainObjectSingleton.shared(MainObjectType.Player).GetComponent <LevController> ().stopMoving();

        if (OnMovieStart != null)
        {
            OnMovieStart();
        }
    }
Esempio n. 29
0
    public void SetCamPos(GUICamPos pos)
    {
        Vector3 levPos = MainObjectSingleton.shared(MainObjectType.Player).transform.position;

        mainCam.transform.rotation = Quaternion.identity;
        if (pos == GUICamPos.Original)
        {
            mainCam.transform.position = oriCamPos;
            mainCam.transform.rotation = oriCamRotate;
        }
        else if (pos == GUICamPos.Up)
        {
            mainCam.transform.position = levPos + deltaCamPosFromLev + deltaCamPos;
        }
        else if (pos == GUICamPos.Down)
        {
            mainCam.transform.position = levPos + deltaCamPosFromLev - deltaCamPos;
        }
        else
        {
            mainCam.transform.position = levPos + deltaCamPosFromLev;
        }
    }
Esempio n. 30
0
    public void MoveCamPos(GUICamPos pos, float camTime, float camDelay, System.Action camCompleteAction)
    {
        Vector3    endCamPos    = Vector3.zero;
        Vector3    levPos       = MainObjectSingleton.shared(MainObjectType.Player).transform.position;
        Quaternion endCamRotate = Quaternion.identity;

        onCamMoveComplete = camCompleteAction;
        if (pos == GUICamPos.Original)
        {
            endCamPos    = oriCamPos;
            endCamRotate = oriCamRotate;
        }
        else if (pos == GUICamPos.Up)
        {
            endCamPos = levPos + deltaCamPosFromLev + deltaCamPos;
        }
        else if (pos == GUICamPos.Down)
        {
            endCamPos = levPos + deltaCamPosFromLev - deltaCamPos;
        }
        else
        {
            endCamPos = levPos + deltaCamPosFromLev;
        }
        iTween.MoveTo(mainCam.gameObject, iTween.Hash("position", endCamPos,
                                                      "time", camTime,
                                                      "delay", camDelay,
                                                      "oncomplete", "OnCamMoveComplete",
                                                      "oncompletetarget", gameObject,
                                                      "ignoretimescale", (Time.timeScale == 0f),
                                                      "easetype", "easeInOutSmoothBreak"));
        iTween.RotateTo(mainCam.gameObject, iTween.Hash("rotation", endCamRotate.eulerAngles,
                                                        "time", camTime,
                                                        "delay", camDelay,
                                                        "ignoretimescale", (Time.timeScale == 0f),
                                                        "easetype", "easeInOutSmoothBreak"));
    }