コード例 #1
0
ファイル: ScaleUp.cs プロジェクト: TanWeiJie96/FYP2
    void Awake()
    {
        if (instance == null)
            //if not, set it to this.
            instance = this;
        //If instance already exists:
        else if (instance != this)
            //Destroy this, this enforces our singleton pattern so there can only be one instance of SoundManager.
            Destroy(gameObject);

        journeyLength = Vector3.Distance(initialScale, scaleUpTo);
    }
コード例 #2
0
ファイル: ShellExplode.cs プロジェクト: ingex0/smarttank
 public ShellExplode ( Vector2 pos, float rota )
 {
     scaleUp = new ScaleUp( Path.Combine( Directories.ContentDirectory, "SceneEffects\\star2" ), new Vector2( 64, 64 ), LayerDepth.EffectLow,
         pos,
         delegate( float curTime,float deltaTime, float lastRadius )
         {
             if (curTime == 0)
                 return 3f;
             else
                 return lastRadius + 0.3f;
         },
         delegate( float curTime )
         {
             return 0;
         }, 20 );
 }
コード例 #3
0
    void ProduceSun()
    {
        if (moneycount <= 0)
        {
            //int x = Random.Range(0, StageMap.ROW_MAX);
            //int y = Random.Range(0, StageMap.COL_MAX);
            //int y = Random.Range(4, 7);
            int[] x_array = new int[5] {
                0, 2, 3, 1, 4
            };
            int[] y_array = new int[5] {
                2, 8, 3, 0, 5
            };

            if (i < 5)
            {
                int x = x_array[i];
                int y = y_array[i];

                if (model.sunMap[x, y] == null)
                {
                    GameObject sun = Instantiate(sunPrefab);
                    sun.transform.position = StageMap.GetSunPos(x, y);

                    ScaleUp scaleup = sun.AddComponent <ScaleUp>();
                    scaleup.Begin();
                    model.sunMap[x, y] = sun;
                }

                i++;
            }

            //int x = Random.Range(0, StageMap.ROW_MAX);
            //int y = Random.Range(0, StageMap.COL_MAX);
            //if (model.sunMap[x, y] == null)
            //{
            //    GameObject sun = Instantiate(sunPrefab);
            //    sun.transform.position = StageMap.GetSunPos(x, y);

            //    ScaleUp scaleup = sun.AddComponent<ScaleUp>();
            //    scaleup.Begin();
            //    model.sunMap[x, y] = sun;
            //}
        }
    }
コード例 #4
0
 public ShellExplodeBeta(Vector2 pos, float rota)
 {
     scaleUp = new ScaleUp(Path.Combine(Directories.ContentDirectory, "SceneEffects\\star2"), new Vector2(64, 64), LayerDepth.EffectLow,
                           pos,
                           delegate(float curTime, float lastRadius)
     {
         if (curTime == 0)
         {
             return(3f);
         }
         else
         {
             return(lastRadius + 0.3f);
         }
     },
                           delegate(float curTime)
     {
         return(0);
     }, 20);
 }