Esempio n. 1
0
    /// <summary>
    /// Create fading ground wit given position
    /// </summary>
    /// <param name="pos"></param>
    public void CreateFadingGround(Vector3 pos, Color color, bool isHitCenter, Transform parent)
    {
        FadingGroundController fgCotrol = GetFadingGround();

        fgCotrol.gameObject.SetActive(true);
        fgCotrol.transform.position = pos;
        fgCotrol.transform.SetParent(parent);
        float scale = (isHitCenter) ? groundLargeScale : groundNormalScale;

        fgCotrol.FadingGround(color, scale, objectFadingTime);
    }
Esempio n. 2
0
    //Get the inactive fading ground object
    private FadingGroundController GetFadingGround()
    {
        foreach (FadingGroundController o in listFadingGroundControl)
        {
            if (!o.gameObject.activeInHierarchy)
            {
                return(o);
            }
        }

        FadingGroundController fadingGroundControl = Instantiate(fadingGroundPrefab, Vector3.zero, Quaternion.identity).GetComponent <FadingGroundController>();

        listFadingGroundControl.Add(fadingGroundControl);
        fadingGroundControl.gameObject.SetActive(false);
        return(fadingGroundControl);
    }