示例#1
0
 public void launchDashNets(Vector3 v, Vector3 v2, GameObject hero, HERO victimHero)
 {
     this.master     = hero;
     this.masterT    = this.master.transform;
     this.masterR    = this.master.rigidbody;
     this.MasterHero = hero.GetComponent <HERO>();
     this.velocity   = v;
     this.velocity2  = Vector3.Project(v2, v);
     this.myRef      = this.MasterHero.hookRefR1;
     this.myRefT     = this.MasterHero.hookRefR1.transform;
     this.nodes      = new ArrayList()
     {
         this.myRefT.position
     };
     this.phase = 0;
     object[] parameters = new object[] { this.MasterHero.photonView.viewID, "hookRefR1" };
     basePV.RPC("myMasterIs", PhotonTargets.Others, parameters);
     object[] objArray2 = new object[] { v, velocity2, false };
     basePV.RPC("setVelocityAndLeft", PhotonTargets.Others, objArray2);
     object[] objArray3 = new object[] { victimHero.photonView.viewID };
     basePV.RPC("tieMeToOBJ", PhotonTargets.Others, objArray3);
     MasterHero.hookToHuman(victimHero.gameObject, baseT.position, true);
     //baseT.parent = victimHero.transform;
     baseT.position = this.myRefT.position;
     baseT.rotation = Quaternion.LookRotation(v.normalized);
     object[] objArray4 = new object[] { 0 };
     basePV.RPC("setPhase", PhotonTargets.Others, objArray4);
 }
示例#2
0
    private void FixedUpdate()
    {
        if (!(((this.phase == 2) || (this.phase == 1)) ? !this.leviMode : true))
        {
            this.spiralcount++;
            if (this.spiralcount >= 60)
            {
                this.isdestroying = true;
                this.removeMe();
                return;
            }
        }
        if ((IN_GAME_MAIN_CAMERA.gametype != GAMETYPE.SINGLE) && !basePV.isMine)
        {
            if (this.phase == 0)
            {
                //Transform transform = base.gameObject.transform;
                baseGT.position += (Vector3)(((this.velocity * Time.deltaTime) * 50f) + (this.velocity2 * Time.deltaTime));
                this.nodes.Add(new Vector3(baseGT.position.x, baseGT.position.y, baseGT.position.z));
            }
        }
        else if (this.phase == 0)
        {
            RaycastHit hit;
            this.checkTitan();
            //Transform transform3 = base.gameObject.transform;
            baseGT.position += (Vector3)(((this.velocity * Time.deltaTime) * 50f) + (this.velocity2 * Time.deltaTime));
            LayerMask mask  = ((int)1) << LayerMask.NameToLayer("EnemyBox");
            LayerMask mask2 = ((int)1) << LayerMask.NameToLayer("Ground");
            LayerMask mask3 = ((int)1) << LayerMask.NameToLayer("NetworkObject");
            LayerMask mask4 = (mask | mask2) | mask3;
            bool      flag  = false;
            bool      flag2 = false;
            if (this.nodes.Count > 1)
            {
                flag2 = Physics.Linecast((Vector3)this.nodes[this.nodes.Count - 2], baseGT.position, out hit, mask4.value);
            }
            else
            {
                flag2 = Physics.Linecast((Vector3)this.nodes[this.nodes.Count - 1], baseGT.position, out hit, mask4.value);
            }
            if (flag2)
            {
                bool      flag3 = true;
                Transform hitT  = hit.collider.transform;
                if (hitT.gameObject.layer == LayerMask.NameToLayer("EnemyBox"))
                {
                    if (IN_GAME_MAIN_CAMERA.gametype == GAMETYPE.MULTIPLAYER)
                    {
                        object[] parameters = new object[] { hitT.root.gameObject.GetPhotonView().viewID };
                        basePV.RPC("tieMeToOBJ", PhotonTargets.Others, parameters);
                    }
                    MasterHero.lastHook = hitT.root;
                    baseT.parent        = hitT;
                }
                else if (hitT.gameObject.layer == LayerMask.NameToLayer("Ground"))
                {
                    MasterHero.lastHook = null;
                }
                else if (((hitT.gameObject.layer == LayerMask.NameToLayer("NetworkObject")) && (hitT.gameObject.tag == "Player")) && !this.leviMode)
                {
                    if (IN_GAME_MAIN_CAMERA.gametype == GAMETYPE.MULTIPLAYER)
                    {
                        object[] objArray2 = new object[] { hitT.root.gameObject.GetPhotonView().viewID };
                        basePV.RPC("tieMeToOBJ", PhotonTargets.Others, objArray2);
                    }
                    MasterHero.hookToHuman(hitT.root.gameObject, baseT.position);
                    baseT.parent        = hitT;
                    MasterHero.lastHook = null;
                }
                else
                {
                    flag3 = false;
                }
                if (this.phase == 2)
                {
                    flag3 = false;
                }
                if (flag3)
                {
                    MasterHero.launch(hit.point, this.left, this.leviMode);
                    baseT.position = hit.point;
                    if (this.phase != 2)
                    {
                        this.phase = 1;
                        if (IN_GAME_MAIN_CAMERA.gametype == GAMETYPE.MULTIPLAYER)
                        {
                            object[] objArray3 = new object[] { 1 };
                            basePV.RPC("setPhase", PhotonTargets.Others, objArray3);
                            object[] objArray4 = new object[] { baseT.position };
                            basePV.RPC("tieMeTo", PhotonTargets.Others, objArray4);
                        }
                        if (this.leviMode)
                        {
                            this.getSpiral(this.masterT.position, this.masterT.rotation.eulerAngles);
                        }
                        flag = true;
                    }
                }
            }
            this.nodes.Add(new Vector3(baseGT.position.x, baseGT.position.y, baseGT.position.z));
            if (!flag)
            {
                this.killTime2 += Time.deltaTime;
                if (this.killTime2 > 0.8f)
                {
                    this.phase = 4;
                    if (IN_GAME_MAIN_CAMERA.gametype == GAMETYPE.MULTIPLAYER)
                    {
                        object[] objArray5 = new object[] { 4 };
                        basePV.RPC("setPhase", PhotonTargets.Others, objArray5);
                    }
                }
            }



            //if (DashHook)
            //{
            //    if (baseT.parent != hit.collider.transform.root.gameObject.transform)
            //    {
            //        this.phase = 4;
            //        object [] objArray4 = new object[] { 4 };
            //        basePV.RPC("setPhase", PhotonTargets.Others, objArray4);
            //        DashHook = false;
            //    }
            //    //else
            //    //{

            //    //}
            //}
        }
    }