Пример #1
0
 void playLookAroundAnim()
 {
     if (lookAroundAnimFrames.Count > 0)
     {
         setCurrentFrame((int)lookAroundAnimFrames[0]);
         lookAroundAnimFrames.RemoveAt(0);
     }
     if (lookAroundAnimFrames.Count == 0)
     {
         createLookAroundAnim();
         ickyState = ickyAnimStates.icky_WaterToLand;
     }
 }
Пример #2
0
 void playShakeOffAnim()
 {
     if (shakeOffAnimFrames.Count > 0)
     {
         setCurrentFrame((int)shakeOffAnimFrames[0]);
         shakeOffAnimFrames.RemoveAt(0);
     }
     if (shakeOffAnimFrames.Count == 0)
     {
         createShakeOffAnim();
         ickyState = ickyAnimStates.icky_turn;
     }
 }
Пример #3
0
 void playWaterToLandedAnim()
 {
     if (waterToLandedAnimFrames.Count > 0)
     {
         setCurrentFrame((int)waterToLandedAnimFrames[0]);
         waterToLandedAnimFrames.RemoveAt(0);
     }
     if (waterToLandedAnimFrames.Count == 0)
     {
         createWaterToLandedAnim();
         ickyState = ickyAnimStates.icky_shakeOff;
     }
 }
Пример #4
0
    // ---- Icky cross pond animation


    // ---- Icky idle animation
    public void playIdleAnim()
    {
        if (idleAnimFrames.Count > 0)
        {
            setCurrentFrame((int)idleAnimFrames[0]);
            idleAnimFrames.RemoveAt(0);
        }
        if (idleAnimFrames.Count == 0)
        {
            createIdleAnim();
            changeTexture = true;
            ickyState     = ickyAnimStates.icky_come;
        }
    }
Пример #5
0
 // ---- Icky  come animation
 public void playComeAnimation()
 {
     if (comeAnimFrames.Count > 0)
     {
         setCurrentFrame((int)comeAnimFrames[0]);
         comeAnimFrames.RemoveAt(0);
     }
     if (comeAnimFrames.Count == 0)
     {
         changeTexture = true;
         createComeAnim();
         ickyState = ickyAnimStates.icky_idle1;
     }
 }
Пример #6
0
 // ---- tickle animation
 public void playTickleAnim()
 {
     if (tickleAnimFrames.Count > 0)
     {
         setCurrentFrame((int)tickleAnimFrames[0]);
         tickleAnimFrames.RemoveAt(0);
     }
     if (tickleAnimFrames.Count == 0)
     {
         createTickleAnim();
         changeTexture = true;
         ickyState     = ickyAnimStates.icky_idle1;
     }
 }
Пример #7
0
    void Start()
    {
        GameObject shapesRef = GameObject.FindGameObjectWithTag("pg_shapes_container");

        if (shapesRef != null)
        {
            soundManager = shapesRef.GetComponent <PG_SoundManager>();
        }
        currentFrame  = 0.0f;
        isAnimating   = true;
        changeTexture = true;
        ickyState     = ickyAnimStates.icky_idle1;
        ickyPrevState = ickyState;
    }
Пример #8
0
    void Update()
    {
        int index = (int)(Time.time * fps);

        if (ickyState != ickyPrevState)
        {
            playIcky_Animations();
            ickyPrevState = ickyState;
        }
        else
        if (index > currentFrame)
        {
            currentFrame = index;
            playIcky_Animations();
        }
    }
Пример #9
0
 public void playWeapAnim()
 {
     if (weapAnimFrames.Count > 0)
     {
         setCurrentFrame((int)weapAnimFrames[0]);
         weapAnimFrames.RemoveAt(0);
     }
     if (weapAnimFrames.Count == 0)
     {
         createWeapAnim();
         changeTexture = true;
         Vector3 pos = transform.localPosition;
         pos.y += 58.5F;
         transform.localPosition = pos;
         ickyState = ickyAnimStates.icky_idle1;
     }
 }
Пример #10
0
    // ---- celebration aniamtion
    public void playCelebrationAnim()
    {
        if (celebrationFrames != null && celebrationFrames.Count > 0)
        {
            setCurrentFrame((int)celebrationFrames[0]);
            celebrationFrames.RemoveAt(0);
        }


        if (celebrationFrames.Count == 0 && !isIckyFilipped)
        {
            gameObject.transform.localScale = new Vector3(-gameObject.transform.localScale.x, gameObject.transform.localScale.y, 1);
            isIckyFilipped = true;
        }

        if (celebrationFrames.Count == 0 && celebrationFramesFlipped != null && celebrationFramesFlipped.Count > 0 && isIckyFilipped)
        {
            setCurrentFrame((int)celebrationFramesFlipped[0]);
            celebrationFramesFlipped.RemoveAt(0);
        }

        if (celebrationFrames.Count == 0 && celebrationFramesFlipped.Count == 0 && isIckyFilipped)
        {
            gameObject.transform.localScale = new Vector3(-gameObject.transform.localScale.x, gameObject.transform.localScale.y, 1);
            isIckyFilipped = false;
        }


        if (celebrationFrames.Count == 0 && celebrationFramesFlipped.Count == 0 && !isIckyFilipped && celebrationLastTwoFrames.Count > 0)
        {
            setCurrentFrame((int)celebrationLastTwoFrames[0]);
            celebrationLastTwoFrames.RemoveAt(0);
        }

        if (celebrationFrames.Count == 0 && celebrationFramesFlipped.Count == 0 && !isIckyFilipped && celebrationLastTwoFrames.Count == 0)
        {
            createCelebrationAnim();
            changeTexture = true;
            ickyState     = ickyAnimStates.icky_idle1;
        }
    }
Пример #11
0
 void playHopAnim()
 {
     if (hopAnimFrames.Count > 0)
     {
         setCurrentFrame((int)hopAnimFrames[count]);
         count++;
         if (count == hopAnimFrames.Count)
         {
             count = 0;
             if (soundManager != null)
             {
                 soundManager.playInstructionSound(new string[] { PG_Constants._soundclipPath + PG_Constants._introClips + PG_Constants._jump });
             }
             hopAnimCount++;
             if (hopAnimCount == 3)
             {
                 count     = 0;
                 ickyState = ickyAnimStates.icky_landToWater;
             }
         }
     }
 }
 // ---- Icky  come animation
 public void playComeAnimation()
 {
     if(comeAnimFrames.Count>0){
       setCurrentFrame((int)comeAnimFrames[0]);
       comeAnimFrames.RemoveAt(0);
     }
     if(comeAnimFrames.Count == 0){
       changeTexture = true;
       createComeAnim();
       ickyState = ickyAnimStates.icky_idle1;
     }
 }
 public void playWeapAnim()
 {
     if(weapAnimFrames.Count>0){
          setCurrentFrame((int)weapAnimFrames[0]);
       	 weapAnimFrames.RemoveAt(0);
     }
     if(weapAnimFrames.Count==0){
         createWeapAnim();
         changeTexture = true;
         Vector3 pos=transform.localPosition;
         pos.y +=58.5F;
         transform.localPosition=pos;
         ickyState = ickyAnimStates.icky_idle1;
     }
 }
 void playHopAnim()
 {
     if(hopAnimFrames.Count>0){
         setCurrentFrame((int)hopAnimFrames[count]);
         count++;
         if(count==hopAnimFrames.Count){
            count=0;
             if(soundManager!=null)
                 soundManager.playInstructionSound(new string[]{PG_Constants._soundclipPath +PG_Constants._introClips +PG_Constants._jump});
            hopAnimCount++;
         if(hopAnimCount==3){
             count=0;
             ickyState = ickyAnimStates.icky_landToWater;
         }
       }
     }
 }
 void playLookAroundAnim()
 {
     if(lookAroundAnimFrames.Count>0){
         setCurrentFrame((int)lookAroundAnimFrames[0]);
         lookAroundAnimFrames.RemoveAt(0);
     }
     if(lookAroundAnimFrames.Count == 0){
         createLookAroundAnim();
         ickyState = ickyAnimStates.icky_WaterToLand;
     }
 }
 void playShakeOffAnim()
 {
     if(shakeOffAnimFrames.Count>0){
         setCurrentFrame((int)shakeOffAnimFrames[0]);
         shakeOffAnimFrames.RemoveAt(0);
     }
     if(shakeOffAnimFrames.Count == 0){
         createShakeOffAnim();
         ickyState = ickyAnimStates.icky_turn;
     }
 }
    void playTurnAnim()
    {
        if(turnAnimFrames.Count>0){
            setCurrentFrame((int)turnAnimFrames[0]);
            turnAnimFrames.RemoveAt(0);
        }
        if(turnAnimFrames.Count == 0){
            createTurnAnim();
            changeTexture = true;
            ickyState = ickyAnimStates.icky_idle1;

        }
    }
 void playWaterToLandedAnim()
 {
     if(waterToLandedAnimFrames.Count>0){
         setCurrentFrame((int)waterToLandedAnimFrames[0]);
         waterToLandedAnimFrames.RemoveAt(0);
     }
     if(waterToLandedAnimFrames.Count == 0){
         createWaterToLandedAnim();
         ickyState = ickyAnimStates.icky_shakeOff;
     }
 }
 void Start()
 {
     GameObject shapesRef	=	GameObject.FindGameObjectWithTag("pg_shapes_container");
     if(shapesRef!=null)
     soundManager					=	shapesRef.GetComponent<PG_SoundManager>();
     currentFrame =0.0f;
     isAnimating   = true;
     changeTexture = true;
     ickyState =ickyAnimStates.icky_idle1;
     ickyPrevState=ickyState;
 }
 // ---- Icky cross pond animation
 // ---- Icky idle animation
 public void playIdleAnim()
 {
     if(idleAnimFrames.Count>0){
     setCurrentFrame((int)idleAnimFrames[0]);
         idleAnimFrames.RemoveAt(0);
     }
     if(idleAnimFrames.Count == 0){
         createIdleAnim();
         changeTexture = true;
         ickyState = ickyAnimStates.icky_come;
     }
 }
    // ---- celebration aniamtion
    public void playCelebrationAnim()
    {
        if(celebrationFrames!=null && celebrationFrames.Count>0){
            setCurrentFrame((int)celebrationFrames[0]);
            celebrationFrames.RemoveAt(0);
        }

        if(celebrationFrames.Count == 0 && !isIckyFilipped){
            gameObject.transform.localScale = new Vector3(-gameObject.transform.localScale.x , gameObject.transform.localScale.y,1);
            isIckyFilipped = true;
        }

        if(celebrationFrames.Count==0 && celebrationFramesFlipped!=null && celebrationFramesFlipped.Count>0 && isIckyFilipped){

            setCurrentFrame((int)celebrationFramesFlipped[0]);
            celebrationFramesFlipped.RemoveAt(0);
        }

        if(celebrationFrames.Count== 0  && celebrationFramesFlipped.Count == 0 && isIckyFilipped){
            gameObject.transform.localScale = new Vector3(-gameObject.transform.localScale.x , gameObject.transform.localScale.y,1);
            isIckyFilipped = false;
        }

        if(celebrationFrames.Count== 0  && celebrationFramesFlipped.Count == 0 && !isIckyFilipped && celebrationLastTwoFrames.Count>0){
            setCurrentFrame((int)celebrationLastTwoFrames[0]);
            celebrationLastTwoFrames.RemoveAt(0);
        }

        if(celebrationFrames.Count== 0  && celebrationFramesFlipped.Count == 0 && !isIckyFilipped && celebrationLastTwoFrames.Count == 0){
            createCelebrationAnim();
            changeTexture = true;
            ickyState = ickyAnimStates.icky_idle1;
        }
    }
 void Update()
 {
     int index=(int)(Time.time*fps);
     if(ickyState!=ickyPrevState){
         playIcky_Animations();
         ickyPrevState=ickyState;
     } else
     if(index > currentFrame){
      	currentFrame = index;
         playIcky_Animations();
     }
 }