Exemple #1
0
        public static CubeKun GetInstance(CubeKun prefab, Vector3 position, Quaternion rotation, Team team)
        {
            var cubekun = PoolManager.GetPoolSafe(prefab.gameObject).Get <CubeKun>(position, rotation);

            cubekun.Team = team;
            cubekun.Initialize();
            return(cubekun);
        }
        public CubeKun Spawn(CubeKun prefab)
        {
            if (!prefab)
            {
                throw new ArgumentNullException("prefab");
            }
            var ins = CubeKun.GetInstance(prefab, Tr.position, Tr.rotation, Team);

            return(ins);
        }
Exemple #3
0
 protected override void OnCubeKunEnter(CubeKun cubekun)
 {
     if (GetTeamRelative(cubekun) != Team.Ally)
     {
         return;
     }
     for (int i = 0; cubekun.Weapons.Length > i; i++)
     {
         cubekun.Weapons[i].Replenishment();
     }
 }
Exemple #4
0
        public void Shot(Transform point, CubeKun parent, int power, float speed, float time)
        {
            var ins = PoolManager.GetPoolSafe(gameObject).Get <Bullet>(point.position, point.rotation);

            Parent = parent;
            ins.gameObject.SetLayer("Bullet_" + parent.Team.ToString());
            ins.power = power;
            ins.speed = speed;
            ins.Trail.Clear();
            ins.DisableStart(time);
        }
Exemple #5
0
 protected virtual void OnCubeKunEnter(CubeKun cubekun)
 {
 }