/// <summary>
    /// Creates the controller.
    /// </summary>
    /// <returns>The controller.</returns>

    FrictionFlowRainController CreateController()
    {
        Transform tr = RainDropTools.CreateHiddenObject("Controller", this.transform);
        FrictionFlowRainController con = tr.gameObject.AddComponent <FrictionFlowRainController> ();

        con.Variables  = Variables;
        con.Alpha      = 0f;
        con.NoMoreRain = false;
        con.camera     = GetComponentInParent <Camera> ();
        return(con);
    }
Ejemplo n.º 2
0
    bool CheckExistence()
    {
        if (!_trail)
        {
            Transform oldTrail = transform.FindChild(_name);
            if (oldTrail)
            {
                _trail        = oldTrail.gameObject;
                _meshFilter   = _trail.GetComponent <MeshFilter>();
                _meshRenderer = _trail.GetComponent <MeshRenderer>();
            }
            else
            {
                _trail = RainDropTools.CreateHiddenObject(_name, this.transform).gameObject;
            }
        }

        if (!_meshFilter)
        {
            _meshFilter = _trail.AddComponent <MeshFilter>();
        }

        if (!_meshRenderer)
        {
            _meshRenderer = _trail.AddComponent <MeshRenderer>();
        }

        if (material == null)
        {
            return(false);
        }
        else
        {
            _meshRenderer.material = material;
        }

        return(true);
    }
 public RainDrawerContainer(string name, Transform parent)
 {
     transform   = RainDropTools.CreateHiddenObject(name, parent);
     this.Drawer = transform.gameObject.AddComponent <T> ();
 }