private IEnumerator NewShapeEffectCorutine(ShapeScriptable _newShape) { float animDur = 0.03f; int currentShapeIndex = ShapeController.GetCurrentShapeIndex(); readInput = false; Direction randomDir = UnityEngine.Random.Range(0, 2) == 0 ? Direction.Right : Direction.Left; for (int i = 0; i < 15; i++) { gameplayPanel.UpdateShape(randomDir, ShapeController.GetShapeByIndex(currentShapeIndex), ShapeController.GetShapeByIndex(currentShapeIndex - 1), ShapeController.GetShapeByIndex(currentShapeIndex + 1), true, animDur); currentShapeIndex++; if (randomDir == Direction.Right) { SwipeController.RightSwipe(); } else { SwipeController.LeftSwipe(); } yield return(new WaitForSeconds(animDur)); } shapeCtrl.ChangeShape(_newShape); readInput = true; }
void Start() { movementPhysics = new MovementPhysics(); swipeController = this.GetComponent <SwipeController>(); myBody = GetComponent <Rigidbody2D>(); grounded = true; }
private void Start() { Instance = this; CanShow = true; WindowAnim = Window.GetComponent <Animator>(); m_Login = FindObjectOfType <LoginController>(); }
void Start() { Player = GameObject.Find("Player"); mPlayerStatusScript = Player.GetComponent <PlayerStatusScript>(); mSwipeController = Player.GetComponent <SwipeController>(); mClickController = Player.GetComponent <ClickController>(); mTriggerScript = GameObject.Find("TriggerDaughter").GetComponent <TriggerScript>(); mAudioSource = GameObject.Find("ScreamSound2").GetComponent <AudioSource>(); mButton = (Texture2D)Resources.Load("btn_press"); gameObjectPrefab = GameObject.FindGameObjectWithTag("Yuriko"); AddAnimationSequence("MoveBackScript", 5.5f, false); IsEnabled = false; IsCrawlOnly = false; mActionSequence = ActionSequence.CRAWL; mButtonSequence1 = (Texture2D)Resources.Load("1 copy"); mButtonSequence2 = (Texture2D)Resources.Load("2 copy"); mButtonSequence3 = (Texture2D)Resources.Load("3 copy"); mButtonSequence4 = (Texture2D)Resources.Load("4 copy"); mButton = (Texture2D)Resources.Load("btn_press"); mButtonPressed = (Texture2D)Resources.Load("gui_press"); mSwipe = (Texture2D)Resources.Load("gui_swipeLeft"); MyStyle = new GUIStyle(); }
void Start() { InitializeTimer(); sc = new SwipeController(); ResetExercise(); currentPhase = CurrentPhaseSquat.SquatNone; }
void Start() { origSpeed = speed; startPos = transform.position; SwipeController.Start(); trailRenderer = GetComponentInChildren <TrailRenderer>(); }
void Start() { gameObjectPrefab = GameObject.FindGameObjectWithTag("Father"); mPlayerStatusScript = GameObject.Find("Player").GetComponent <PlayerStatusScript>(); mClickController = GameObject.Find("Player").GetComponent <ClickController>(); mSwipeController = GameObject.Find("Player").GetComponent <SwipeController>(); mTriggerScript = GameObject.Find("TriggerFather").GetComponent <TriggerScript>(); AddAnimationSequence("MoveScript", mTimeIdle, false); mAudioSource = GameObject.Find("ScreamSound").GetComponent <AudioSource>(); mButton = (Texture2D)Resources.Load("btn_press"); mButtonPressed = (Texture2D)Resources.Load("gui_press"); mSwipe = (Texture2D)Resources.Load("gui_swipeRight"); mTime = 0.0f; mTimeIdle = 0.0f; mTimeInput = 3.0f; mImageTime = 0.0f; mImageTimeMax = 0.5f; mValueX = 0.45f; mValueY = 0.45f; mValueOffSet = 0.1f; mIsCompleted = false; mSetInitialVal = true; mIsDamaged = false; //AddAnimationSequence("AttackScript", 2.0f, false); MyStyle = new GUIStyle(); }
private void Awake() { // Asuming only one of each of the following swipeController = FindObjectOfType<SwipeController>(); cameraHandle = FindObjectOfType<CameraHandle>(); platformController = FindObjectOfType<PlatformController>(); score = FindObjectOfType<Score>(); }
protected override void Awake() { base.Awake(); this._touchDetectionIsActive = true; this._myPlaneDetectionController = GetComponent <MyPlaneDetectionController>(); this._swipeController = GetComponent <SwipeController>(); }
void Awake() { var cardInput = transform.Find("CardInput"); _swipeController = cardInput.Find("SwipeArea").GetComponent <SwipeController>(); _indicatorController = cardInput.Find("Indicators").GetComponent <IndicatorController>(); _swipeController.OnSuccess += (_, __) => _indicatorController.LightSuccess(); _swipeController.OnFail += (_, __) => _indicatorController.LightFail(); }
private void Awake() { if (instance == null) { instance = this; } else { Destroy(gameObject); } }
// Use this for initialization void Start() { //set references gameManager = GameObject.Find("GameManager").GetComponent <GameManager> (); combo = GetComponent <ComboCounter> (); swipeCont = gameManager.GetComponent <SwipeController> (); hp = 2; //set amount of lives currentSpeed = walkSpeed; //set speed to walk dashRemaining = dashDistance; //set dash counter to maximum distance }
void Start() { if (_instance != null) { Destroy(this.gameObject); return; } _instance = this; gyroInput = GetComponent <GyroInput> (); swipeController = GetComponent <SwipeController> (); DontDestroyOnLoad(gameObject); }
// Use this for initialization void Start() { book = GameObject.Find("book"); page_left = GameObject.Find("page_left"); page_right = GameObject.Find("page_right"); flip_pageleft = GameObject.Find("flip_pageleft"); flip_pageright = GameObject.Find("flip_pageright"); SwipeController sw = gameObject.GetComponent <SwipeController>(); sw.onSwipeCallBack = OnSwipe; }
/// <summary> /// Called before the first frame. /// </summary> void Start() { InitializeTimer(); sc = new SwipeController(); ResetExercise(); currentPhase = CurrentPhaseBench.BenchNone; // DEBUG USE ONLY if (gameData.CurrentAttempt == 0) { gameData.OverrideAttemptsDebug(ExerciseType.Bench); gameplayController.OverrideLoad(); } }
void Update() { if (isDead) { return; } if (Game.inMenu) { return; } SwipeController.Update(); MoveUpdate(); }
// Use this for initialization void Start() { Screen.orientation = (ScreenOrientation)PlayerPrefs.GetInt("ScreenOrientation", (int)ScreenOrientation.LandscapeLeft); shapeController = GetComponent<ShapeController>(); swipeController = GetComponent<SwipeController>(); playerBody = GetComponent<Rigidbody2D>(); localHighScores = GetComponent<LocalHighScore>(); levelGenerator = GetComponent<LevelGenerator>(); levelGenerator.AddAllPrefabsToPooler(); maxPlayerSpeedSquared = MaxPlayerSpeed * MaxPlayerSpeed; //Restart(); StartCoroutine(MoveTowardsGoalCoroutine()); }
void Start() { CreateSwipeGesture(); CreateLongPressGesture(); _fingerManager = GameObject.FindGameObjectWithTag("FingerManager"); _match3Controller = _fingerManager.GetComponent <Match3Controller>(); _swipeController = _fingerManager.GetComponent <SwipeController>(); _balls = new List <GameObject>(); _rb = GetComponent <Rigidbody2D>(); #if UNITY_EDITOR flickForce = 0.3f; #else flickForce = 0.03f; #endif }
// Start is called before the first frame update void Start() { if (startGame == null) { startGame = new UnityEvent(); } if (endGame == null) { endGame = new UnityEvent(); } tutorialUIRef = GameObject.FindGameObjectWithTag("TutorialUI"); swipeContRef = gameObject.GetComponent <SwipeController>(); animationController = gameObject.GetComponent <AnimationController>(); paintContRef = PaintController.request(); rb = gameObject.GetComponent <Rigidbody>(); startXPos = transform.position.x; startYRot = transform.rotation.y; }
// Use this for initialization void Awake() { if (animator == null) { animator = GameObject.FindObjectOfType <Animator>(); } if (animator == null) { return; } _swipeController = GetComponentInChildren <SwipeController>(true); if (_swipeController != null) { _swipeController.OnDragEvent -= OnDragEvent; _swipeController.OnDragEvent += OnDragEvent; } }
public override void Tick() { if (!startState) { return; } if (changeShapeDelayTimer > 0) { changeShapeDelayTimer -= Time.deltaTime; return; } if ((readInput || isTutorial) && SwipeController.IsSwiping(Direction.Right)) { SwipeController.RightSwipe(); shapeCtrl.ChangeShape(Direction.Right, true); changeShapeDelayTimer = changeShapeDelayTime; if (isTutorial) { EndTutorial(); } } else if ((readInput || isTutorial) && SwipeController.IsSwiping(Direction.Left)) { SwipeController.LeftSwipe(); shapeCtrl.ChangeShape(Direction.Left, true); changeShapeDelayTimer = changeShapeDelayTime; if (isTutorial) { EndTutorial(); } } }
private void Awake() { i = this; }
// Start is called before the first frame update void Start() { swipe = GetComponent <SwipeController>(); }
void Start() { sc = GameObject.Find("Scene Manager").gameObject.GetComponent <SwipeController>(); initialGravityDirection = gravityDirection; }
private void Start() { controller = GetComponent <CharacterController>(); swipeController = GetComponent <SwipeController>(); }
void Start() { swipeController = GetComponent <SwipeController>(); drawController = GetComponent <DrawController>(); }
[System.NonSerialized] public RaycastHit hit; // Ray hit information to store. void Awake() { instance = this; // Set the class instance; }
private void OnSwipe(object sender, SwipeController.SwipeEventArgs swipeEventArgs) { if (state == State.Slide) { if (swipeEventArgs.hand == Hand.Right) { nextSlide(); } else { prevSlide(); } } }
void Start() { instance = this; dragDistance = Screen.height * 15 / 100; }
private void Awake() { instance = this; }
private IEnumerator Prepare() { _btnBack.onClick.AddListener(BackButtonPressedHandler); _btnRestart.onClick.AddListener(RestartButtonPressedHandler); _gameDataModel = new GameDataModel(); _gameDataModel.Chef.CurrentStars = _remoteConfigsService.Configs.GameConfig.StartStarsCount; var background = Resources.Load <Sprite>(_remoteConfigsService.Configs.GameConfig.GameBackGroundImageName); if (background == null) { throw new UnassignedReferenceException($"{nameof(background)}: {_remoteConfigsService.Configs.GameConfig.GameBackGroundImageName} not found!"); } _backGround.sprite = background; _chefUI.Init(_localConfig, _gameDataModel.Chef); _starsUI.Init(_gameDataModel.Chef); _queueSwipes = new Queue <int>(); _inputController = new SwipeController(OnSwipeDetected, _localConfig, _remoteConfigsService.Configs.GameConfig); float createStartTime = 0; var shelf = Random.Range(0, _localConfig.Shelfs.Count); shelfList = new List <int>(); for (var i = 0; i < _remoteConfigsService.Configs.GameConfig.FreshVegatablesCount; i++) { shelf = GetIndexShelf(shelf); VegetableModel newVegetable; newVegetable = CreateVegetableModel(true, shelf); newVegetable.CreateTime = createStartTime - _remoteConfigsService.Configs.GameConfig.Vegetables[newVegetable.VegetableConfigIndex].DurationOfPath; _gameDataModel.Vegetables.Add(newVegetable); if (Random.value <= _remoteConfigsService.Configs.GameConfig.PercentageOfSpoiledVegetables) { shelf = GetIndexShelf(shelf); newVegetable = CreateVegetableModel(false, Utils.RandomExclude(_localConfig.Shelfs.Count, shelf)); newVegetable.CreateTime = createStartTime - _remoteConfigsService.Configs.GameConfig.Vegetables[newVegetable.VegetableConfigIndex].DurationOfPath - _remoteConfigsService.Configs.GameConfig.VegetablesCreateRate / 2; _gameDataModel.Vegetables.Add(newVegetable); } createStartTime += _remoteConfigsService.Configs.GameConfig.VegetablesCreateRate; } _gameDataModel.Vegetables.Sort((a, b) => { return(a.CreateTime.CompareTo(b.CreateTime)); } ); for (int i = _gameDataModel.Vegetables.Count; i > 0; i--) { _gameDataModel.Vegetables[i - 1].CreateTime -= (_gameDataModel.Vegetables[0].CreateTime - _remoteConfigsService.Configs.GameConfig.AfterStartDelay); } #if UNITY_EDITOR DebugInfo(); #endif StartCoroutine(GameProcess()); yield return(null); }