Example #1
0
 protected virtual void GotCaught(Catchables newCatch)
 {
     if (newCatch == this)
     {
         _gotCaught = true;
         FindMyMouth();
         myMouth.connectedBody = isSubmarine ? HookBehaviourSubmarine.Single.FindHook() : HookBehaviour.Single.FindHook();
         myPersonalTrigger();
     }
 }
Example #2
0
        /// <summary>
        /// "Instantiates" a <see cref="Runtime.Catchables"/> prefab.
        ///
        /// This method should not contain any "decision making", and should only handle the "engine-y" stuff.
        /// Decision making should go in <see cref="SpawnFish"/> instead.
        /// </summary>
        /// <param name="fishToInstantiate"></param>
        /// <param name="position"></param>
        /// <param name="distanceFromGround"></param>
        /// <param name="rotation"></param>
        /// <param name="fishScale"></param>
        /// <returns></returns>
        private static Catchables InstantiateFish(Catchables fishToInstantiate, Spacey.IWorldly position, float distanceFromGround, Quaternion rotation, float fishScale)
        {
            var newFish = Object.Instantiate(
                fishToInstantiate,
                position.Worldly + (Vector3.up * distanceFromGround),
                rotation,
                FishHolder.Value
                );

            newFish.ScaleUp(fishScale);
            return(newFish);
        }
Example #3
0
        public FutureFish(
            Catchables catchables,
            Spacey.IWorldly position,
            float distanceFromGround,
            Quaternion rotation,
            float scale
            )
        {
            Catchables         = catchables;
            _spawnPosition     = position;
            DistanceFromGround = distanceFromGround;
            Rotation           = rotation;
            Scale = scale;

            Portents.Add(this);
        }
Example #4
0
        public bool Instantiate()
        {
            if (Instantiated)
            {
                return(false);
            }

            Catchables.gameObject.SetActive(false);

            Instance = InstantiateFish(
                Catchables,
                Position,
                DistanceFromGround,
                Rotation,
                Scale
                );

            Instantiated = true;
            return(true);
        }
Example #5
0
 protected void CollisionCatchable(Catchables newCatch)
 {
     myCatches.Add(newCatch);
 }