示例#1
0
    void OnEnable()
    {
        primitive = (CloudGenerator)target;

        fill     = serializedObject.FindProperty("fill");
        offset   = serializedObject.FindProperty("addPos");
        space    = serializedObject.FindProperty("space");
        verts    = serializedObject.FindProperty("vertexCount");
        children = serializedObject.FindProperty("MeshInChildren");
    }
示例#2
0
    public void Init(CloudGenerator cloudGenerator, Vector3 direction, float depth, float speed, float despawnXPosition)
    {
        this.cloudGenerator   = cloudGenerator;
        this.direction        = direction;
        this.depth            = depth;
        this.speed            = speed;
        this.despawnXPosition = despawnXPosition;

        isInitialised = true;
    }
示例#3
0
    private void Awake()
    {
        platformGenerator = new PlatformGenerator(platforms);
        platformGenerator.CreatePlatforms();

        starGenerator = new StarGenerator(stars, player.gameObject);
        starGenerator.CreateStars(starDensity);

        cloudGenerator = new CloudGenerator(clouds, player.gameObject);
        cloudGenerator.CreateClouds(cloudDensity);


        killZone = GameObject.FindWithTag("Kill Zone");
    }
    override protected void Start()
    {
        base.Start();

        cg = transform.parent.GetComponent <CloudGenerator>();

        if (cg == null)
        {
            Debug.LogError("Cloud Generator not found or isn't a parent of cloud " + GetInstanceID());
            gameObject.SetActive(false);
        }

        LocalWindModifier = Vector3.zero; // Change to some little values, maybe modify slightly in update ?
    }
示例#5
0
        public void SetUp()
        {
            cloudOptions = DefaultCloudOptions;

            randomWords = Enumerable.Range(0, 50)
                          .Select(wordNumber => TestsHelper.GetRandomString((wordNumber / 10 + 1) * 2,
                                                                            TestContext.CurrentContext.Random))
                          .ToArray();
            excludedWords = randomWords.Where(word => word.Length <= 2);

            vocabularyParser = A.Fake <ICloudVocabularyParser>();

            A.CallTo(() => vocabularyParser.GetCloudVocabulary(DefaultCloudOptions.CloudVocabularyFilename))
            .Returns(randomWords.AsEnumerable().AsResult());
            A.CallTo(() => vocabularyParser.GetCloudVocabulary(
                         DefaultCloudOptions.ExcludedWordsVocabularyFilename))
            .Returns(excludedWords.AsEnumerable().AsResult());

            contextGenerator = new CloudContextGenerator(cloudOptions, vocabularyParser);
            cloudGenerator   = new CloudGenerator(contextGenerator, PreprocessorConstructor);
        }
示例#6
0
 /// <summary>
 /// Start the clouds appearing
 /// </summary>
 public override void CreateClouds()
 {
     if (mesh.vertexCount == 0)
     {
         CloudGenerator cloudGenerator = new CloudGenerator(mesh, NumberOfClouds, MaterialRows, MaterialColumns);
         cloudGenerator.AngularVelocityRange = AngularVelocityRange;
         cloudGenerator.BoundsRadius         = BoundsRadius;
         cloudGenerator.BoundsCenter         = BoundsCenter;
         cloudGenerator.BoundsHeightRange    = BoundsHeightRange;
         cloudGenerator.FadeTimeRange        = FadeTimeRange;
         cloudGenerator.FadeTimeDelayRange   = FadeTimeDelayRange;
         cloudGenerator.LifeTimeRange        = LifeTimeRange;
         cloudGenerator.RadiusRange          = RadiusRange;
         cloudGenerator.VelocityRangeX       = VelocityRangeX;
         cloudGenerator.VelocityRangeZ       = VelocityRangeZ;
         cloudGenerator.CreateClouds();
         cloudGenerator.Apply();
     }
     else
     {
         CloudGenerator.ShowClouds(mesh, LifeTimeRange, FadeTimeRange, FadeTimeDelayRange);
     }
     SetFlareEnabled(false);
 }
示例#7
0
 private void Awake()
 {
     Instance = this;
 }
示例#8
0
 /// <summary>
 /// Start the clouds disappearing
 /// </summary>
 public override void RemoveClouds()
 {
     CloudGenerator.HideClouds(mesh, FadeTimeRange, FadeTimeDelayRange);
     SetFlareEnabled(true);
 }
示例#9
0
    //Gets a new cloud at runtime using the component's settings
    void Start()
    {
        CloudGenerator gen = FindObjectOfType <CloudGenerator>();

        GetComponent <MeshFilter>().sharedMesh = gen.RuntimeCloud();
    }
示例#10
0
 void Start()
 {
     m_cloudGenerator = FindObjectOfType <CloudGenerator>();
     m_emittersToFade = GetComponentsInChildren <ParticleSystem>();
     m_camera         = Camera.main.transform;
 }
示例#11
0
 void Start()
 {
     cloudGenerator = gameObject.GetComponentInParent <CloudGenerator>();
 }