Example #1
0
    private void SetPogPosition(Pog pog, int index)
    {
        float pogHeight = PogManager.Instance.PogSettings.PogHeight;

        Vector3 position = transform.position;

        position.y += pogHeight * index * (pogHeight / 2.0f);

        pog.transform.position = position;
    }
Example #2
0
    private static void CreatePog(PogTower pt)
    {
        GameObject pogObject = (GameObject)PrefabUtility
                               .InstantiatePrefab(PogManager.Instance.PogSettings.PogPrefab);

        Pog pog = pogObject.GetComponent <Pog>();

        pog.transform.SetParent(pt.transform);

        pt.AddPog(pog);
    }
Example #3
0
    private static void DestroyPog(PogTower pt)
    {
        if (pt.PogList.Count == 0)
        {
            return;
        }

        Pog pog = pt.PogList[pt.PogList.Count - 1];

        pt.RemovePog(pog);

        GameObject.DestroyImmediate(pog.gameObject);
    }
Example #4
0
 public void RemovePog(Pog pog)
 {
     _pogList.Remove(pog);
 }
Example #5
0
 public void AddPog(Pog pog)
 {
     _pogList.Add(pog);
 }