Example #1
0
    public void OnDrawGizmosSelected()
    {
        if (AutoWayPoint.waypoints.get_length() == 0)
        {
            this.RebuildWaypointList();
        }
        IEnumerator enumerator = UnityRuntimeServices.GetEnumerator(this.connected);

        while (enumerator.MoveNext())
        {
            AutoWayPoint autoWayPoint = (AutoWayPoint)RuntimeServices.Coerce(enumerator.Current, typeof(AutoWayPoint));
            if (Physics.Linecast(this.get_transform().get_position(), autoWayPoint.get_transform().get_position()))
            {
                Gizmos.set_color(Color.get_red());
                Gizmos.DrawLine(this.get_transform().get_position(), autoWayPoint.get_transform().get_position());
                UnityRuntimeServices.Update(enumerator, autoWayPoint);
            }
            else
            {
                Gizmos.set_color(Color.get_green());
                Gizmos.DrawLine(this.get_transform().get_position(), autoWayPoint.get_transform().get_position());
                UnityRuntimeServices.Update(enumerator, autoWayPoint);
            }
        }
    }
Example #2
0
    public override void endFire()
    {
        this.fireStarted = false;
        if (this.burnP.GetComponent <ParticleEmitter>())
        {
            this.burnP.GetComponent <ParticleEmitter>().emit = false;
        }
        IEnumerator enumerator = UnityRuntimeServices.GetEnumerator(this.burnP);

        while (enumerator.MoveNext())
        {
            object arg_5E_0;
            object expr_44 = arg_5E_0 = enumerator.Current;
            if (!(expr_44 is Transform))
            {
                arg_5E_0 = RuntimeServices.Coerce(expr_44, typeof(Transform));
            }
            Transform transform = (Transform)arg_5E_0;
            if (transform.GetComponent <ParticleEmitter>())
            {
                transform.GetComponent <ParticleEmitter>().emit = false;
                UnityRuntimeServices.Update(enumerator, transform);
            }
        }
        UnityEngine.Object.Destroy(this);
    }
Example #3
0
 // Token: 0x060003CF RID: 975 RVA: 0x0004C2F8 File Offset: 0x0004A4F8
 public virtual void Update()
 {
     if (!this.HomeYandere.CanMove)
     {
         if (!this.Loaded)
         {
             this.StartCoroutine_Auto(this.PhotoGallery.GetPhotos());
             this.Loaded = true;
         }
         if (!this.PhotoGallery.Adjusting && !this.PhotoGallery.Viewing && !this.PhotoGallery.LoadingScreen.active && Input.GetButtonDown("B"))
         {
             this.HomeCamera.Destination           = this.HomeCamera.Destinations[0];
             this.HomeCamera.Target                = this.HomeCamera.Targets[0];
             this.HomeCamera.CorkboardLabel.active = true;
             this.PhotoGallery.enabled             = false;
             this.HomeYandere.CanMove              = true;
             this.HomeYandere.active               = true;
             this.HomeWindow.Show = false;
             this.enabled         = false;
             this.Loaded          = false;
             if (RuntimeServices.EqualityOperator(UnityRuntimeServices.GetProperty(this.HomeCamera, "DisablePost"), false))
             {
             }
         }
     }
 }
Example #4
0
    public override void ExplodeShip()
    {
        GameObject gameObject = GameObject.Find("Astronaut");

        if (!gameObject)
        {
            MonoBehaviour.print("NO AST");
        }
        object target  = Object.Instantiate(this.asteroidExplosion, gameObject.get_transform().get_position(), gameObject.get_transform().get_rotation());
        object target2 = UnityRuntimeServices.Invoke(target, "GetComponent", new object[]
        {
            "Detonator"
        }, typeof(MonoBehaviour));

        RuntimeServices.SetProperty(target2, "size", 22);
        AudioSource.PlayClipAtPoint(this.asteroidExplosionSound, gameObject.get_transform().get_position());
        GameObject gameObject2 = GameObject.Find("CockpitLowerPlane");
        GameObject gameObject3 = GameObject.Find("Windshield1");
        GameObject gameObject4 = GameObject.Find("Windshield2");
        GameObject gameObject5 = GameObject.Find("daiserCylinder");

        Object.Destroy(gameObject2);
        Object.Destroy(gameObject);
        Object.Destroy(gameObject3);
        Object.Destroy(gameObject4);
        Object.Destroy(gameObject5);
    }
Example #5
0
 public override void Fire()
 {
     this.beamOrient.get_transform().set_rotation(Quaternion.FromToRotation(Vector3.get_forward(), this.ray.get_direction()));
     if (Time.get_time() - this.lastFireTime > this.chickenDelay)
     {
         AudioSource.PlayClipAtPoint(this.chickenSound, this.get_transform().get_position(), (float)1);
         GameObject gameObject = (GameObject)Object.Instantiate(this.chickenBeamPrefab, this.launchPos.get_transform().get_position(), this.beamOrient.get_transform().get_rotation());
         object     component  = gameObject.GetComponent("ChickenBeam");
         UnityRuntimeServices.Invoke(component, "Go", new object[]
         {
             this.get_rigidbody().get_velocity()
         }, typeof(MonoBehaviour));
         this.lastFireTime = Time.get_time();
         this.chickenDelay = Random.Range(this.minChickenDelay, this.maxChickenDelay);
     }
     else
     {
         AudioSource.PlayClipAtPoint(this.shootSound, this.get_transform().get_position(), (float)1);
         GameObject gameObject = (GameObject)Object.Instantiate(this.beamPrefab, this.launchPos.get_transform().get_position(), this.beamOrient.get_transform().get_rotation());
         object     component2 = gameObject.GetComponent("EggBeam");
         UnityRuntimeServices.Invoke(component2, "Go", new object[]
         {
             this.get_rigidbody().get_velocity()
         }, typeof(MonoBehaviour));
     }
 }
Example #6
0
 public override void Update()
 {
     if (Input.GetKeyDown(KeyCode.UpArrow))
     {
         IEnumerator enumerator = UnityRuntimeServices.GetEnumerator(this.GetComponent <Animation>());
         while (enumerator.MoveNext())
         {
             object arg_40_0;
             object expr_26 = arg_40_0 = enumerator.Current;
             if (!(expr_26 is AnimationState))
             {
                 arg_40_0 = RuntimeServices.Coerce(expr_26, typeof(AnimationState));
             }
             AnimationState animationState = (AnimationState)arg_40_0;
             animationState.speed += 0.2f;
             UnityRuntimeServices.Update(enumerator, animationState);
         }
     }
     else if (Input.GetKeyDown(KeyCode.DownArrow))
     {
         IEnumerator enumerator2 = UnityRuntimeServices.GetEnumerator(this.GetComponent <Animation>());
         while (enumerator2.MoveNext())
         {
             object arg_AF_0;
             object expr_95 = arg_AF_0 = enumerator2.Current;
             if (!(expr_95 is AnimationState))
             {
                 arg_AF_0 = RuntimeServices.Coerce(expr_95, typeof(AnimationState));
             }
             AnimationState animationState2 = (AnimationState)arg_AF_0;
             animationState2.speed -= 0.2f;
             UnityRuntimeServices.Update(enumerator2, animationState2);
         }
     }
     if (this.currentClip == 0)
     {
         this.GetComponent <Animation>().CrossFade("walk", 0.2f);
     }
     else if (this.currentClip == 1)
     {
         this.GetComponent <Animation>().CrossFade("run", 0.2f);
     }
     else if (this.currentClip == 2)
     {
         this.GetComponent <Animation>().CrossFade("lookOut", 0.2f);
     }
     if (!this.GetComponent <Animation>().isPlaying)
     {
         this.currentClip++;
         if (this.currentClip == 3)
         {
             this.currentClip = 0;
         }
     }
 }
Example #7
0
    public override void Explode()
    {
        object  obj        = Object.Instantiate(this.confettiEmitter1, this.get_transform().get_position(), this.get_transform().get_rotation());
        Vector3 localScale = this.get_transform().get_localScale();
        object  property   = UnityRuntimeServices.GetProperty(obj, "transform");

        RuntimeServices.SetProperty(property, "localScale", localScale);
        UnityRuntimeServices.PropagateValueTypeChanges(new UnityRuntimeServices.ValueTypeChange[]
        {
            new UnityRuntimeServices.MemberValueTypeChange(obj, "transform", property)
        });
        MonoBehaviour.print(RuntimeServices.InvokeBinaryOperator("op_Addition", "Confetti Sphere local scale = ", UnityRuntimeServices.GetProperty(UnityRuntimeServices.GetProperty(obj, "transform"), "localScale")));
        Vector3 vector    = new Vector3((float)10, (float)10, (float)10);
        object  property2 = UnityRuntimeServices.GetProperty(obj, "transform");

        RuntimeServices.SetProperty(property2, "localScale", vector);
        UnityRuntimeServices.PropagateValueTypeChanges(new UnityRuntimeServices.ValueTypeChange[]
        {
            new UnityRuntimeServices.MemberValueTypeChange(obj, "transform", property2)
        });
        obj = Object.Instantiate(this.confettiEmitter2, this.get_transform().get_position(), this.get_transform().get_rotation());
        Vector3 localScale2 = this.get_transform().get_localScale();
        object  property3   = UnityRuntimeServices.GetProperty(obj, "transform");

        RuntimeServices.SetProperty(property3, "localScale", localScale2);
        UnityRuntimeServices.PropagateValueTypeChanges(new UnityRuntimeServices.ValueTypeChange[]
        {
            new UnityRuntimeServices.MemberValueTypeChange(obj, "transform", property3)
        });
        MonoBehaviour.print(RuntimeServices.InvokeBinaryOperator("op_Addition", "Confetti Sphere local scale = ", UnityRuntimeServices.GetProperty(UnityRuntimeServices.GetProperty(obj, "transform"), "localScale")));
        Vector3 vector2   = new Vector3((float)10, (float)10, (float)10);
        object  property4 = UnityRuntimeServices.GetProperty(obj, "transform");

        RuntimeServices.SetProperty(property4, "localScale", vector2);
        UnityRuntimeServices.PropagateValueTypeChanges(new UnityRuntimeServices.ValueTypeChange[]
        {
            new UnityRuntimeServices.MemberValueTypeChange(obj, "transform", property4)
        });
        object obj2 = Object.Instantiate(this.explosionPrefab, this.get_transform().get_position(), this.get_transform().get_rotation());
        object obj3 = UnityRuntimeServices.Invoke(obj2, "GetComponent", new object[]
        {
            "Detonator"
        }, typeof(MonoBehaviour));

        RuntimeServices.SetProperty(obj3, "size", 1);
        AudioSource.PlayClipAtPoint(this.explosionSound, this.get_transform().get_position(), (float)1);
        this.SpewBeans();
        checked
        {
            GameController.instance.gameEnemies = GameController.instance.gameEnemies - 1;
            GameController.instance.gameScore   = GameController.instance.gameScore + 10;
            Object.Destroy(this.get_gameObject());
        }
    }
Example #8
0
    public override void ToggleVisibility()
    {
        object      componentsInChildren = this.get_gameObject().GetComponentsInChildren(typeof(Renderer));
        IEnumerator enumerator           = UnityRuntimeServices.GetEnumerator(componentsInChildren);

        while (enumerator.MoveNext())
        {
            Renderer renderer = (Renderer)RuntimeServices.Coerce(enumerator.get_Current(), typeof(Renderer));
            renderer.set_enabled(!renderer.get_enabled());
            UnityRuntimeServices.Update(enumerator, renderer);
        }
    }
Example #9
0
 public override void OnCollisionEnter(Collision col)
 {
     checked
     {
         if (RuntimeServices.EqualityOperator(UnityRuntimeServices.GetProperty(col.get_gameObject(), "tag"), "free"))
         {
             Debug.Log("I'm FREE!  Thank You Kind Toon!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!");
             this.numHits++;
             Score.score++;
         }
     }
 }
Example #10
0
    public override string GetNameFromString(object theString)
    {
        object target = UnityRuntimeServices.Invoke(theString, "Split", new object[]
        {
            ", ".get_Chars(0)
        }, typeof(MonoBehaviour));

        return((string)RuntimeServices.Coerce(RuntimeServices.GetSlice(target, string.Empty, new object[]
        {
            0
        }), typeof(string)));
    }
Example #11
0
    public void RebuildWaypointList()
    {
        object[] array = Object.FindObjectsOfType(typeof(AutoWayPoint));
        AutoWayPoint.waypoints = new Array(array);
        IEnumerator enumerator = UnityRuntimeServices.GetEnumerator(AutoWayPoint.waypoints);

        while (enumerator.MoveNext())
        {
            AutoWayPoint autoWayPoint = (AutoWayPoint)RuntimeServices.Coerce(enumerator.Current, typeof(AutoWayPoint));
            autoWayPoint.RecalculateConnectedWaypoints();
            UnityRuntimeServices.Update(enumerator, autoWayPoint);
        }
    }
Example #12
0
    public override void ManualRestart()
    {
        object component = this.GUICam.GetComponent("GameController");

        UnityRuntimeServices.Invoke(component, "SetGameOver", new object[]
        {
            true
        }, typeof(MonoBehaviour));
        UnityRuntimeServices.Invoke(component, "TimedGameRestart", new object[]
        {
            3,
            this.get_transform().get_position()
        }, typeof(MonoBehaviour));
    }
 // Token: 0x06000016 RID: 22 RVA: 0x00003A60 File Offset: 0x00001C60
 public virtual void ModelChange(string _name)
 {
     if (!string.IsNullOrEmpty(_name))
     {
         MonoBehaviour.print("ModelChange : " + _name);
         this.curModelName = Path.GetFileNameWithoutExtension(_name);
         GameObject original = (GameObject)Resources.Load(_name, typeof(GameObject));
         UnityEngine.Object.Destroy(this.obj);
         Debug.Log(_name);
         this.obj                    = (((GameObject)UnityEngine.Object.Instantiate(original)) as GameObject);
         this.SM                     = (((SkinnedMeshRenderer)this.obj.GetComponentInChildren(typeof(SkinnedMeshRenderer))) as SkinnedMeshRenderer);
         this.SM.quality             = SkinQuality.Bone4;
         this.SM.updateWhenOffscreen = true;
         int        num             = 0;
         int        i               = 0;
         Material[] sharedMaterials = this.SM.renderer.sharedMaterials;
         int        length          = sharedMaterials.Length;
         while (i < length)
         {
             if (sharedMaterials[i].name == "face02_M")
             {
                 this.SM.renderer.materials[num] = this.faceMat_M;
             }
             else if (sharedMaterials[i].name == "face02_L")
             {
                 this.SM.renderer.materials[num] = this.faceMat_L;
             }
             num++;
             i++;
         }
         IEnumerator enumerator = UnityRuntimeServices.GetEnumerator(this.animTest.animation);
         while (enumerator.MoveNext())
         {
             object obj = enumerator.Current;
             object obj3;
             object obj2 = obj3 = obj;
             if (!(obj2 is AnimationState))
             {
                 obj3 = RuntimeServices.Coerce(obj2, typeof(AnimationState));
             }
             AnimationState animationState = (AnimationState)obj3;
             this.obj.animation.AddClip(animationState.clip, animationState.name);
             UnityRuntimeServices.Update(enumerator, animationState);
         }
         this.viewCam.ModelTarget(this.GetBone(this.obj, this.boneName));
         this.SetAnimation(string.Empty + this.animationList[this.curAnim]);
         this.SetAnimationSpeed(this.animSpeed);
     }
 }
Example #14
0
    public override void SpawnExplosion()
    {
        Ray        ray        = Camera.get_main().ScreenPointToRay(Input.get_mousePosition());
        RaycastHit raycastHit = default(RaycastHit);
        GameObject gameObject;

        if (Physics.Raycast(ray, ref raycastHit, (float)1000))
        {
            object  value  = RuntimeServices.InvokeBinaryOperator("op_Division", UnityRuntimeServices.GetProperty(this.currentDetonator.GetComponent("Detonator"), "size"), 3);
            Vector3 vector = raycastHit.get_point() + Vector3.Scale(raycastHit.get_normal(), new Vector3(RuntimeServices.UnboxSingle(value), RuntimeServices.UnboxSingle(value), RuntimeServices.UnboxSingle(value)));
            gameObject = (GameObject)Object.Instantiate(this.currentDetonator, vector, Quaternion.get_identity());
            RuntimeServices.SetProperty(gameObject.GetComponent("Detonator"), "detail", this.detailLevel);
        }
        Object.Destroy(gameObject, this.explosionLife);
    }
Example #15
0
 public override void StartBoosters()
 {
     if (!this.instanBoostersExists)
     {
         this.instanBoosters = Object.Instantiate(this.boostersPrefab, this.boostersPos.get_transform().get_position(), this.boostersPos.get_transform().get_rotation());
         Transform transform = this.boostersPos.get_transform();
         object    property  = UnityRuntimeServices.GetProperty(this.instanBoosters, "transform");
         RuntimeServices.SetProperty(property, "parent", transform);
         UnityRuntimeServices.PropagateValueTypeChanges(new UnityRuntimeServices.ValueTypeChange[]
         {
             new UnityRuntimeServices.MemberValueTypeChange(this.instanBoosters, "transform", property)
         });
         this.instanBoostersExists = true;
     }
 }
Example #16
0
    public override int GetScoreFromString(object theString)
    {
        object target = UnityRuntimeServices.Invoke(theString, "Split", new object[]
        {
            ", ".get_Chars(0)
        }, typeof(MonoBehaviour));

        return(RuntimeServices.UnboxInt32(RuntimeServices.Invoke(typeof(UnityBuiltins), "parseInt", new object[]
        {
            RuntimeServices.GetSlice(target, string.Empty, new object[]
            {
                1
            })
        })));
    }
Example #17
0
 public override void OnCollisionEnter(Collision collision)
 {
     checked
     {
         this.state++;
         if (this.state > 0)
         {
             this.grounded = true;
         }
         if (RuntimeServices.EqualityOperator(UnityRuntimeServices.GetProperty(collision.get_gameObject(), "tag"), "notTray"))
         {
             Object.Destroy(this.get_gameObject());
         }
     }
 }
	public override void Update()
	{
		if (Time.get_time() - this.startTime > this.middleRingTimer && this.canAnimateMiddle)
		{
			this.canAnimateMiddle = false;
			UnityRuntimeServices.Invoke(this.doodleWall.GetComponent("PenWallControl"), "SetMiddleRing", new object[0], typeof(MonoBehaviour));
			this.canAnimateInner = true;
		}
		else if (Time.get_time() - this.startTime > this.innerRingTimer && this.canAnimateInner)
		{
			this.canAnimateInner = false;
			UnityRuntimeServices.Invoke(this.doodleWall.GetComponent("AudioSource"), "Play", new object[0], typeof(MonoBehaviour));
			UnityRuntimeServices.Invoke(this.doodleWall.GetComponent("PenWallControl"), "SetInnerRing", new object[0], typeof(MonoBehaviour));
		}
	}
Example #19
0
 public override void SpewBeans()
 {
     for (int i = 0; i < this.beanCount; i = checked (i + 1))
     {
         float num  = this.get_transform().get_localScale().x * 0.5f;
         float num2 = this.get_transform().get_position().x + Random.Range(-num, num);
         float num3 = this.get_transform().get_position().y + Random.Range(-num, num);
         float num4 = this.get_transform().get_position().z + Random.Range(-num, num);
         int   num5 = Random.Range(0, 4);
         int   num6 = num5;
         if (num6 == 0)
         {
             GameObject gameObject = (GameObject)Object.Instantiate(this.jellybeanPrefab, new Vector3(num2, num3, num4), this.get_transform().get_rotation());
             UnityRuntimeServices.Invoke(gameObject.GetComponent(typeof(YellowHardCandy)), "Setup", new object[]
             {
                 this.asteroidSize,
                 this.velScale
             }, typeof(MonoBehaviour));
         }
         else if (num6 == 1)
         {
             GameObject gameObject = (GameObject)Object.Instantiate(this.spacelipsPrefab, new Vector3(num2, num3, num4), this.get_transform().get_rotation());
             UnityRuntimeServices.Invoke(gameObject.GetComponent(typeof(YellowHardCandy)), "Setup", new object[]
             {
                 this.asteroidSize,
                 this.velScale
             }, typeof(MonoBehaviour));
         }
         else if (num6 == 2)
         {
             GameObject gameObject = (GameObject)Object.Instantiate(this.lollyPrefab, new Vector3(num2, num3, num4), this.get_transform().get_rotation());
             UnityRuntimeServices.Invoke(gameObject.GetComponent(typeof(Lolly)), "Setup", new object[]
             {
                 this.asteroidSize,
                 this.velScale
             }, typeof(MonoBehaviour));
         }
         else if (num6 == 3)
         {
             GameObject gameObject = (GameObject)Object.Instantiate(this.whistlePrefab, new Vector3(num2, num3, num4), this.get_transform().get_rotation());
             UnityRuntimeServices.Invoke(gameObject.GetComponent(typeof(BlueWhistle)), "Setup", new object[]
             {
                 this.asteroidSize,
                 this.velScale
             }, typeof(MonoBehaviour));
         }
     }
 }
 public override void FixedUpdate()
 {
     if (Time.get_time() - this.startTime > (float)2)
     {
         if (!this.animStarted)
         {
             object componentInChildren = this.GetComponentInChildren(typeof(Animation));
             UnityRuntimeServices.Invoke(componentInChildren, "Play", new object[]
             {
                 "fall"
             }, typeof(MonoBehaviour));
             this.animStarted = true;
         }
         this.get_rigidbody().set_useGravity(true);
         this.get_rigidbody().AddForce((float)-3 * this.get_transform().get_up(), 1);
     }
 }
    public override void Explode()
    {
        object target  = Object.Instantiate(this.explosionPrefab, this.get_transform().get_position(), this.get_transform().get_rotation());
        object target2 = UnityRuntimeServices.Invoke(target, "GetComponent", new object[]
        {
            "Detonator"
        }, typeof(MonoBehaviour));

        RuntimeServices.SetProperty(target2, "size", 7);
        AudioSource.PlayClipAtPoint(this.explosionSound, this.get_transform().get_position());
        checked
        {
            GameController.instance.gameEnemies = GameController.instance.gameEnemies - 1;
            GameController.instance.gameScore   = GameController.instance.gameScore + 10;
            Object.Destroy(this.get_gameObject());
        }
    }
Example #22
0
    public void WanderAnimation()
    {
        PetState petState = (PetState)this.GetComponent(typeof(PetState));

        if (!this.wanderFirstTime)
        {
            if (!this.get_animation().IsPlaying("WanderActions[0].anim"))
            {
                this.get_animation().CrossFade(this.WanderActions[0].anim);
            }
            float num  = (float)20;
            float num2 = 0f;
            if (Time.get_time() - this.timeLastTurn > (float)4)
            {
                num2                = (float)0;
                this.randomRot      = (float)Random.Range(25, 45);
                this.startDirection = this.get_transform().get_rotation();
                this.newDirection   = Quaternion.get_identity();
                float num3 = this.get_transform().get_eulerAngles().y + this.randomRot;
                this.newDirection.set_eulerAngles(new Vector3((float)0, num3, (float)0));
                int num4 = Random.Range(1, 3);
                this.turnIncr     = (float)num4 * num / Mathf.Abs(this.randomRot);
                this.turnIncr     = (float)1 / Mathf.Abs(this.randomRot);
                this.turnTimer    = this.turnIncr;
                this.timeLastTurn = Time.get_time();
            }
            if (this.turnTimer < this.randomRot)
            {
                this.get_transform().set_rotation(Quaternion.Slerp(this.startDirection, this.newDirection, this.turnTimer));
                this.get_transform().set_eulerAngles(new Vector3((float)0, this.get_transform().get_eulerAngles().y, (float)0));
                this.turnTimer += this.turnIncr;
                if (this.turnTimer >= this.randomRot)
                {
                    this.randomRot = (float)0;
                    this.turnTimer = (float)0;
                }
            }
            Vector3 vector  = this.get_transform().TransformDirection(Vector3.get_forward());
            Vector3 vector2 = vector * this.moveSpeed;
            UnityRuntimeServices.Invoke(this.GetComponent(typeof(CharacterController)), "SimpleMove", new object[]
            {
                vector2
            }, typeof(MonoBehaviour));
        }
    }
    // Token: 0x06000017 RID: 23 RVA: 0x00003C64 File Offset: 0x00001E64
    public virtual void SetAnimationSpeed(float _speed)
    {
        IEnumerator enumerator = UnityRuntimeServices.GetEnumerator(this.obj.animation);

        while (enumerator.MoveNext())
        {
            object obj = enumerator.Current;
            object obj3;
            object obj2 = obj3 = obj;
            if (!(obj2 is AnimationState))
            {
                obj3 = RuntimeServices.Coerce(obj2, typeof(AnimationState));
            }
            AnimationState animationState = (AnimationState)obj3;
            animationState.speed = _speed;
            UnityRuntimeServices.Update(enumerator, animationState);
        }
    }
Example #24
0
    public void RecalculateConnectedWaypoints()
    {
        this.connected = new Array();
        IEnumerator enumerator = UnityRuntimeServices.GetEnumerator(AutoWayPoint.waypoints);

        while (enumerator.MoveNext())
        {
            AutoWayPoint autoWayPoint = (AutoWayPoint)RuntimeServices.Coerce(enumerator.Current, typeof(AutoWayPoint));
            if (!(autoWayPoint == this))
            {
                if (!Physics.CheckCapsule(this.get_transform().get_position(), autoWayPoint.get_transform().get_position(), AutoWayPoint.kLineOfSightCapsuleRadius))
                {
                    this.connected.Add(autoWayPoint);
                    UnityRuntimeServices.Update(enumerator, autoWayPoint);
                }
            }
        }
    }
Example #25
0
 public override void OnCollisionEnter(Collision collision)
 {
     checked
     {
         this.bounceCount++;
         if (RuntimeServices.EqualityOperator(UnityRuntimeServices.GetProperty(collision.get_gameObject(), "tag"), "notTray"))
         {
             this.Kill();
         }
         if (this.bounceCount > this.numOfBounces)
         {
             ContactPoint contactPoint = collision.get_contacts()[0];
             Quaternion   quaternion   = Quaternion.FromToRotation(Vector3.get_up(), contactPoint.get_normal());
             Object.Instantiate(this.explosion, contactPoint.get_point(), quaternion);
             this.Kill();
         }
     }
 }
    public void FollowAnimation()
    {
        PetState petState = (PetState)this.GetComponent(typeof(PetState));

        if (!this.get_animation().IsPlaying("FollowActions[0]"))
        {
            this.get_animation().CrossFade(this.FollowActions[0]);
        }
        RaycastHit raycastHit = default(RaycastHit);
        Vector3    vector     = this.get_transform().TransformDirection(Vector3.get_forward());
        Vector3    vector2    = this.get_transform().TransformDirection(Vector3.get_forward());
        Vector3    vector3    = vector2 * this.moveSpeed;

        UnityRuntimeServices.Invoke(this.GetComponent(typeof(CharacterController)), "SimpleMove", new object[]
        {
            vector3
        }, typeof(MonoBehaviour));
        this.RotateTowards(this.owner.get_transform().get_position());
    }
    public override int Hit()
    {
        checked
        {
            this.asteroidHitPoints--;
        }
        int arg_10E_0;

        if (this.asteroidHitPoints == 1)
        {
            object  target     = Object.Instantiate(this.candyWrapperOpen, this.get_transform().get_position(), Quaternion.get_identity());
            Vector3 localScale = this.get_transform().get_localScale();
            object  property   = UnityRuntimeServices.GetProperty(target, "transform");
            RuntimeServices.SetProperty(property, "localScale", localScale);
            UnityRuntimeServices.PropagateValueTypeChanges(new UnityRuntimeServices.ValueTypeChange[]
            {
                new UnityRuntimeServices.MemberValueTypeChange(target, "transform", property)
            });
            Object.Instantiate(this.wrapperSparkle, this.get_transform().get_position(), Quaternion.get_identity());
            Transform transform = this.get_transform().Find("pink_candy/PCANDY:wrapper");
            if (transform)
            {
                transform.get_renderer().set_enabled(false);
            }
            else
            {
                MonoBehaviour.print("did not find child wrapper");
            }
            this.startDelay = Time.get_time();
            arg_10E_0       = 0;
        }
        else if (this.asteroidHitPoints <= 0 && Time.get_time() - this.startDelay > (float)1)
        {
            this.Explode();
            arg_10E_0 = 1;
        }
        else
        {
            arg_10E_0 = 0;
        }
        return(arg_10E_0);
    }
Example #28
0
    public static AutoWayPoint FindClosest(Vector3 pos)
    {
        AutoWayPoint result     = null;
        float        num        = 100000f;
        IEnumerator  enumerator = UnityRuntimeServices.GetEnumerator(AutoWayPoint.waypoints);

        while (enumerator.MoveNext())
        {
            AutoWayPoint autoWayPoint = (AutoWayPoint)RuntimeServices.Coerce(enumerator.Current, typeof(AutoWayPoint));
            float        num2         = Vector3.Distance(autoWayPoint.get_transform().get_position(), pos);
            UnityRuntimeServices.Update(enumerator, autoWayPoint);
            if (num2 < num)
            {
                num    = num2;
                result = autoWayPoint;
                UnityRuntimeServices.Update(enumerator, autoWayPoint);
            }
        }
        return(result);
    }
 // Token: 0x06000326 RID: 806 RVA: 0x00041CF4 File Offset: 0x0003FEF4
 public virtual void CloseDoor()
 {
     this.Prompt.Label[0].text = "     " + "Open";
     this.Open  = false;
     this.Timer = (float)0;
     if (this.HidingSpot)
     {
         this.HideCollider.gameObject.AddComponent("BoxCollider");
         int       num       = 2;
         Component component = this.HideCollider.GetComponent("BoxCollider");
         object    property  = UnityRuntimeServices.GetProperty(component, "size");
         RuntimeServices.SetProperty(property, "z", num);
         UnityRuntimeServices.PropagateValueTypeChanges(new UnityRuntimeServices.ValueTypeChange[]
         {
             new UnityRuntimeServices.MemberValueTypeChange(component, "size", property)
         });
         RuntimeServices.SetProperty(this.HideCollider.GetComponent("BoxCollider"), "isTrigger", true);
         this.HideCollider.MyCollider = (Collider)this.HideCollider.GetComponent("BoxCollider");
     }
 }
    public AutoWayPoint PickNextWaypoint(AutoWayPoint currentWaypoint)
    {
        Vector3      vector     = this.get_transform().TransformDirection(Vector3.get_forward());
        AutoWayPoint result     = currentWaypoint;
        float        num        = 10f * (float)-1;
        IEnumerator  enumerator = UnityRuntimeServices.GetEnumerator(currentWaypoint.connected);

        while (enumerator.MoveNext())
        {
            AutoWayPoint autoWayPoint = (AutoWayPoint)RuntimeServices.Coerce(enumerator.Current, typeof(AutoWayPoint));
            Vector3      vector2      = Vector3.Normalize(autoWayPoint.get_transform().get_position() - this.get_transform().get_position());
            UnityRuntimeServices.Update(enumerator, autoWayPoint);
            float num2 = Vector3.Dot(vector2, vector);
            if (num2 > num && autoWayPoint != currentWaypoint)
            {
                num    = num2;
                result = autoWayPoint;
                UnityRuntimeServices.Update(enumerator, autoWayPoint);
            }
        }
        return(result);
    }