IEnumerator Fall(S2C.BuildingFall pck) { yield return new WaitForFixedUpdate(); Debug.Log("Fall Frame: " + Time.frameCount); for (int i = 0; i < pck.m_IDs.Length; i++) { BuildingManager.Inst.Get((ushort)pck.m_IDs[i]).Fall(); } }
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); }