public void OnInject() { pysicItem.SetPosition(transform.position); Container.Inject(pysicItem); pysicItem.itemWidth = size.x; pysicItem.itemHeight = size.y; }
public void SetPos(Vector2Int pos) { spawnPos = pos; viewReciver = GetComponent <UnitViewReciver>(); pysicItem = viewReciver.pysicItem; transform.position = new Vector3(pos.x * TileDataProvider.TileSize, pos.y * TileDataProvider.TileSize + 3, transform.position.z); pysicItem.SetPosition(transform.position); }
public void ReSpawnFromDead() { gameObject.SetActive(false); CooldownManager.AddCooldown(3, null, () => { pysicItem.AddVelocity(-pysicItem.velocity); transform.position = new Vector3(spawnPos.x * TileDataProvider.TileSize, spawnPos.y * TileDataProvider.TileSize + 3, transform.position.z); pysicItem.SetPosition(transform.position); SetHP(100); gameObject.SetActive(true); }); }
public virtual void OnInject() { Container.Inject(pysicItem); pysicItem.itemWidth = size.x; pysicItem.itemHeight = size.y; pysicItem.SetMomentVector(momentVector); pysicItem.SetGravity(gravity); pysicItem.SetPosition(transform.position); pysicItem.ReboundFactor = ReboundFactor; }
public void Init(Vector2Int pos) { spawnPos = pos; viewReciver = GetComponent <UnitViewReciver>(); pysicItem = viewReciver.pysicItem; transform.position = new Vector3(pos.x * TileDataProvider.TileSize, pos.y * TileDataProvider.TileSize + 3, transform.position.z); pysicItem.SetPosition(transform.position); pysicItem.OnCollision += OnCollision; maxHp = 100; currHp = 100; // TargetManager.Player = this; }