public void LoadPlayerIndicator() { if (gamePlayerIndicator == null) { gamePlayerIndicator = GamePlayerIndicator.AddIndicator(gameObject, actionCode); //gamePlayerIndicator.alwaysVisible = true; } }
public static GamePlayerIndicator AddIndicator( GameObject target, string gameIndicatorType, Color colorTo) { GamePlayerIndicator indicator = GamePlayerIndicator.AddIndicator(target, "default", gameIndicatorType); UIUtil.SetSpriteColor(indicator.gameObject, colorTo); return(indicator); }
public void UpdateIndicator() { if (!AppModes.Instance.isAppModeGameTraining) { GamePlayerIndicator.AddIndicator( gameObject, GamePlayerIndicatorType.goal); } }
public static GamePlayerIndicator AddIndicator( GameObject parentObject, GameObject target, string type, string gameIndicatorType) { // Spawn indicator // target new player string modelPath = ContentPaths.appCacheVersionSharedPrefabLevelUI + "GamePlayerIndicatorHUD"; //LogUtil.Log("AddIndicator:modelPath:" + modelPath); GameObject prefabIndicator = Resources.Load(modelPath) as GameObject; //LogUtil.Log("AddIndicator:prefabIndicator:" + prefabIndicator.name); if (prefabIndicator != null) { GameObject indicator = GameObjectHelper.CreateGameObject( prefabIndicator, Vector3.zero, Quaternion.identity, GameConfigs.usePooledIndicators); indicator.transform.parent = parentObject.transform; indicator.ResetPosition(); if (indicator != null) { //LogUtil.Log("AddIndicator:indicator:" + indicator.name); GamePlayerIndicator indicatorObj = indicator.GetComponent <GamePlayerIndicator>(); if (indicatorObj != null) { //LogUtil.Log("AddIndicator:indicatorObj:" + indicatorObj.name); //LogUtil.Log("AddIndicator:gameIndicatorType:" + gameIndicatorType); //LogUtil.Log("AddIndicator:target.transform.name:" + target.transform.name); indicatorObj.HideIndicator(); indicatorObj.indicatorType = GamePlayerIndicatorPlacementType.SCREEN; indicatorObj.SetTarget(target.transform); indicatorObj.transform.localScale = Vector3.one; indicatorObj.type = gameIndicatorType;//(GamePlayerIndicatorType)Enum.Parse(typeof(GamePlayerIndicatorType), gameIndicatorType); indicatorObj.SetGameIndicatorType(gameIndicatorType); indicatorObj.Run(); } return(indicatorObj); } } return(null); }
public void loadDataChoiceItems() { LogUtil.Log("loadDataChoiceItems"); int i = 0; LogUtil.Log("loadDataChoiceItems:" + i); AppContentChoice choice = GetCurrentChoice(); if (choice != null) { float x = -60; foreach (AppContentChoiceItem choiceItem in choice.choices) { // Add to list string levelName = "choice" + choice.code + "-" + choiceItem.code + "-" + i; if (!listGridRoot.ContainsChild(levelName)) { GameObject item = NGUITools.AddChild(listGridRoot, prefabListItem); item.name = levelName; GameObjectChoice choiceObject = item.Get <GameObjectChoice>(); if (choiceObject != null) { choiceObject.LoadChoiceItem(choice, choiceItem, GetColor(i)); } } // Add to level string levelNameItem = "choice-item" + choice.code + "-" + choiceItem.code + "-" + i; if (!GameController.Instance.levelItemsContainerObject.ContainsChild(levelNameItem)) { GameObject itemLevel = NGUITools.AddChild(GameController.Instance.levelItemsContainerObject, prefabLevelItem); itemLevel.name = levelNameItem; GameObjectChoice choiceObjectLevel = itemLevel.Get <GameObjectChoice>(); if (choiceObjectLevel != null) { choiceObjectLevel.LoadChoiceItem(choice, choiceItem, GetColor(i)); GamePlayerIndicator indicator = GamePlayerIndicator.AddIndicator( itemLevel, GamePlayerIndicatorType.choice, GetColor(i)); if (indicator != null) { indicator.SetIndicatorColorEffects(GetColor(i)); } } choiceObjectLevel.transform.position = Vector3.zero.WithX(x += (UnityEngine.Random.Range(20, 60) * 1)).WithZ(UnityEngine.Random.Range(-30, 30)); } i++; } } }
// STRING public static GamePlayerIndicator AddIndicator( GameObject target, string gameIndicatorType) { return(GamePlayerIndicator.AddIndicator(target, "default", gameIndicatorType)); }
public static GamePlayerIndicator AddIndicator( GameObject target, GamePlayerIndicatorType type, Color colorTo) { return(GamePlayerIndicator.AddIndicator(target, type.ToString(), colorTo)); }
public static GamePlayerIndicator AddIndicator( GameObject target, string type, string gameIndicatorType) { return(GamePlayerIndicator.AddIndicator(GameHUD.Instance.containerOffscreenIndicators, target, type, gameIndicatorType)); }