public RopableController(IRopable owner, RopableID ID) { m_owner = owner; m_ropableID = ID; m_InfectingRopes = new List<Rope>(); }
void OnSetRopeStuck(S2C.RopeStickInfo info) { stickInfo = info; if (stickInfo.isSticked == false) return; IRopable ropable; switch(info.m_RID.m_type) { case ObjectType.TILE: ropable = TileManager.Inst.Get((ushort)info.m_RID.m_ID); break; case ObjectType.BUILDING: ropable = BuildingManager.Inst.Get((ushort)info.m_RID.m_ID); break; case ObjectType.PLAYER: ropable = PlayerManager.Inst.Get((int)info.m_RID.m_ID); break; /* case ObjectType.PROJECTILE: ropable = ProjectileManager.Inst.Get(info.m_RID.m_ID); break; */ default: return; } transform.position = stickInfo.position; GetComponent<Rigidbody2D>().velocity = new Vector2(0f, 0f); ropable.Roped(this, info.position); ropeTarget = ropable; ropeSource = PlayerManager.Inst.Get(owner); }
void Stick(IRopable ropable, Vector2 position) { GetComponent<Rigidbody2D>().velocity = new Vector2(0f, 0f); ropable.Roped(this, position); ropeTarget = ropable; stickInfo = new S2C.RopeStickInfo(true, ropable.GetRopableID(), position); GetComponent<NetworkView>().RPC("SetRopeStuck", RPCMode.Others, stickInfo.SerializeToBytes()); }
void ConnectRope(IRopable ropable) { if (stickInfo.isSticked) return; Stick(ropable, transform.position); ConnectToOwner(); }