Example #1
0
    private void OnEnable()
    {
        FMODCommon.PreloadEvents(new string[]
        {
            this.dieEvent,
            this.sharkAttackEvent
        });
        if (!this.initBool)
        {
            return;
        }
        this.hitBlock = false;
        this.resetAttack();
        this.setupInvokes();
        if (this.animator)
        {
            this.animator.SetBool("Dead", false);
        }
        float time = UnityEngine.Random.Range(0.1f, 3f);

        if (!base.IsInvoking("updatePlayerTargets"))
        {
            base.InvokeRepeating("updatePlayerTargets", time, 2f);
        }
    }
Example #2
0
 private void Start()
 {
     FMODCommon.PreloadEvents(new string[]
     {
         this.playerSightedEvent
     });
 }
Example #3
0
 private void OnEnable()
 {
     FMODCommon.PreloadEvents(new string[]
     {
         this.dieEvent,
         this.sharkAttackEvent
     });
     base.transform.rotation = Quaternion.identity;
     this.diff             = base.transform.forward;
     this.desiredDirection = base.transform.forward;
     this.desiredRotation  = base.transform.rotation;
     this.lastRotation     = base.transform.rotation;
     this.direction        = base.transform.forward;
     this.hitBool          = false;
     if (!this.initBool)
     {
         return;
     }
     this.hitBlock = false;
     this.resetAttack();
     this.setupInvokes();
     if (this.animator)
     {
         this.animator.SetBool("Dead", false);
     }
     float num = UnityEngine.Random.Range(0.1f, 3f);
 }
Example #4
0
 private void OnEnable()
 {
     this.tr                    = base.transform;
     this.anim                  = base.gameObject.GetComponent <Animator>();
     this.ragDoll               = base.GetComponent <clsragdollify>();
     this.layerMask1            = 67108864;
     this.lastPos               = this.tr.position;
     this.smallCircleCheckDelay = Time.time + 5f;
     this.idleAnimationHash     = Animator.StringToHash("Base Layer.Idle");
     this.flyTagHash            = Animator.StringToHash("flying");
     this.hopIntHash            = Animator.StringToHash("hop");
     this.flyingBoolHash        = Animator.StringToHash("flying");
     this.peckBoolHash          = Animator.StringToHash("peck");
     this.ruffleBoolHash        = Animator.StringToHash("ruffle");
     this.preenBoolHash         = Animator.StringToHash("preen");
     this.landingBoolHash       = Animator.StringToHash("landing");
     this.singTriggerHash       = Animator.StringToHash("sing");
     this.flyingDirectionHash   = Animator.StringToHash("flyingDirectionX");
     this.anim.SetFloatReflected("IdleAgitated", this.agitationLevel);
     this.onFire = false;
     this.health = 1;
     if (this.anim.enabled)
     {
         this.anim.SetBool(this.flyingBoolHash, true);
         this.anim.SetBool(this.landingBoolHash, false);
     }
     if (!base.IsInvoking("groundHeightCheck"))
     {
         FMODCommon.PreloadEvents(this.AllEventPaths());
     }
     this.fleeing = false;
 }
Example #5
0
 private void OnEnable()
 {
     if (this.delayAfterSpawn > 0f)
     {
         this.waitingForSpawnTimeout = true;
         base.Invoke("EndSpawnTimeout", this.delayAfterSpawn);
     }
     else
     {
         this.waitingForSpawnTimeout = false;
     }
     this.sqrImpactSpeedThreshold = this.impactSpeedThreshold * this.impactSpeedThreshold;
     this.sqrSlideSpeedThreshold  = this.slideSpeedThreshold * this.slideSpeedThreshold;
     this.collider  = base.GetComponent <Collider>();
     this.rigidbody = base.GetComponent <Rigidbody>();
     if (!this.rigidbody)
     {
         base.enabled = false;
         return;
     }
     if (this.slideObjects == null)
     {
         this.slideObjects = new List <GameObject>();
     }
     else
     {
         this.slideObjects.Clear();
     }
     FMODCommon.PreloadEvents(new string[]
     {
         this.impactEvent,
         this.slideEvent
     });
     this.hasPreloaded = true;
 }
Example #6
0
 private void doAwake()
 {
     this.enemyHitMask = 36841472;
     this.rootTr       = base.transform.root;
     this.thisCollider = base.transform.GetComponent <Collider>();
     if (!this.netPrefab)
     {
         this.setup = base.transform.root.GetComponentInChildren <mutantScriptSetup>();
         this.ai    = base.transform.root.GetComponentInChildren <mutantAI>();
     }
     if (this.netPrefab)
     {
         this.hitPrediction = base.transform.root.GetComponent <CoopMutantClientHitPrediction>();
         this.ai_net        = base.transform.root.GetComponentInChildren <mutantAI_net>();
     }
     this.props     = base.transform.root.GetComponentInChildren <mutantPropManager>();
     this.animator  = base.transform.root.GetComponentInChildren <Animator>();
     this.events    = base.transform.root.GetComponentInChildren <enemyAnimEvents>();
     this.blockHash = Animator.StringToHash("block");
     FMODCommon.PreloadEvents(new string[]
     {
         this.weaponHitEvent,
         this.parryEvent,
         this.blockEvent,
         this.shellBlockEvent
     });
     this.hasPreloaded = true;
 }
Example #7
0
 private void OnEnable()
 {
     FMODCommon.PreloadEvents(new string[]
     {
         this.addItemEvent
     });
     this.hasPreloaded = true;
 }
Example #8
0
 private void Start()
 {
     FMODCommon.PreloadEvents(new string[]
     {
         this.tree,
         this.water
     });
 }
Example #9
0
    public IEnumerator beginPlaneCrash()
    {
        this.preloadEvents = new string[]
        {
            "event:/ambient/plane_start/body_fly_past",
            "event:/ambient/plane_start/fall_forward",
            "event:/ambient/plane_start/flight_attendant",
            "event:/ambient/plane_start/hit_ground",
            "event:/ambient/plane_start/hit_screen",
            "event:/ambient/plane_start/take_timmy",
            "event:/ambient/plane_start/notebook_plane_sequence"
        };
        FMODCommon.PreloadEvents(this.preloadEvents);
        this.hasPreloadedEvents = true;
        this.clientCutScenePlayerGo.SetActive(false);
        if (BoltNetwork.isClient)
        {
            this.iconGo.SetActive(false);
        }
        Scene.HudGui.ShowHud(false);
        if (this.IconsAndTextMain)
        {
            this.IconsAndTextMain.SetActive(false);
        }
        this.SpaceTut.SetActive(true);
        Clock.planecrash           = true;
        this.disabled              = false;
        this.skipOpening           = false;
        Scene.Atmosphere.TimeOfDay = 302f;
        this.Atm.LightingTimeOfDayOverrideValue = 180f;
        this.Atm.OverrideLightingTimeOfDay      = true;
        this.Atm.FogMaxHeight              = 1500f;
        this.Hud.enabled                   = false;
        LocalPlayer.Inventory.enabled      = false;
        LocalPlayer.Inventory.CurrentView  = PlayerInventory.PlayerViews.PlaneCrash;
        LocalPlayer.FpCharacter.enabled    = false;
        LocalPlayer.FpCharacter.Locked     = true;
        LocalPlayer.MainRotator.enabled    = false;
        this.storeCameraDamp               = LocalPlayer.CamRotator.dampingTime;
        LocalPlayer.CamRotator.dampingTime = 0f;
        this.planeController.beginPlaneCrash();
        if (BoltNetwork.isClient)
        {
            base.StartCoroutine("lockPlayerPosition");
        }
        if (!this.crawl)
        {
            this.crawl = this.PlaneReal.GetComponentInChildren <setupPlayerCrawl>();
        }
        this.crawl.gameObject.SetActive(false);
        this.timmySleepGo.SetActive(true);
        this.pmTrigger.SendEvent("begin");
        LocalPlayer.MainCam.SendMessage("GuiOff");
        if (BoltNetwork.isServer)
        {
            LocalPlayer.Transform.position += new Vector3(2f, 0f, 0f);
        }
        yield return(new WaitForSeconds(0.1f));

        this.setupClouds();
        yield return(new WaitForSeconds(0.4f));

        base.StartCoroutine(this.enablePlayerControl());
        yield return(new WaitForSeconds(0.7f));

        this.finishedInitialLoad = true;
        this.PlaySounds();
        this.getBook = false;
        while (!this.getBook)
        {
            if (BoltNetwork.isClient)
            {
                break;
            }
            yield return(null);
        }
        if (BoltNetwork.isClient)
        {
            this.clientPlayerOnPlaneGo.GetComponent <Animator>().SetFloat("clientBlend", 1f);
            this.clientPlayerOnPlaneGo.GetComponent <Animator>().SetBool("client", true);
        }
        FMODCommon.PlayOneshot("event:/ambient/plane_start/notebook_plane_sequence", this.playerSeatPos);
        this.playerSeatGo.GetComponent <Animator>().SetBool("toBook", true);
        this.pmTrigger.SendEvent("continue");
        base.Invoke("resetBook", 1f);
        this.planeController.setupCameraShake();
        yield return(new WaitForSeconds(9f));

        this.playerSeatGo.GetComponent <playerPlaneControl>().book.SetActive(false);
        yield return(new WaitForSeconds(9.8f));

        base.StartCoroutine(this.moveCloudsRoutine(this._stormClouds.transform));
        this.ScreenFlight.SetActive(false);
        this.ScreenFlightTimmy.SetActive(false);
        this.ScreenFlightClient.SetActive(false);
        this.ScreenCrash.SetActive(true);
        this.ScreenCrashTimmy.SetActive(true);
        this.ScreenCrashClient.SetActive(true);
        this.planeController.startCrashCameraShake();
        this.ShowDamage();
        yield return(new WaitForSeconds(25f));

        this.SmokeOn();
        yield break;
    }
Example #10
0
 private void OnEnable()
 {
     FMODCommon.PreloadEvents(this.AllEventPaths());
 }