public void AddGameObject(GameObject go, CanvasAnchor anchor = 0, bool destroyOnSceneLoad = false, CanvasScaleMode scaleMode = 1) { CanvasAnchors anchors = (scaleMode != CanvasScaleMode.HEIGHT) ? this.m_widthScale : this.m_heightScale; TransformUtil.AttachAndPreserveLocalTransform(go.transform, anchors.GetAnchor(anchor)); if (destroyOnSceneLoad) { this.DestroyOnSceneLoad(go); } }
public Transform GetAnchor(CanvasAnchor type) { if (type != CanvasAnchor.CENTER) { if (type == CanvasAnchor.BOTTOM_LEFT) { return(this.m_BottomLeft); } if (type == CanvasAnchor.BOTTOM_RIGHT) { return(this.m_BottomRight); } if (type == CanvasAnchor.TOP_LEFT) { return(this.m_TopLeft); } if (type == CanvasAnchor.TOP_RIGHT) { return(this.m_TopRight); } } return(this.m_Center); }
public Triton.Game.Mapping.Notification CreateCharacterQuote(string prefabName, string text, string soundName, bool allowRepeatDuringSession, float durationSeconds, CanvasAnchor anchorPoint) { object[] objArray1 = new object[] { prefabName, text, soundName, allowRepeatDuringSession, durationSeconds, anchorPoint }; return(base.method_15 <Triton.Game.Mapping.Notification>("CreateCharacterQuote", new Class272.Enum20[] { Class272.Enum20.String }, objArray1)); }
public void PlayCharacterQuote(Triton.Game.Mapping.Notification quote, Vector3 position, string text, string soundName, float durationSeconds, CanvasAnchor anchorPoint) { object[] objArray1 = new object[] { quote, position, text, soundName, durationSeconds, anchorPoint }; base.method_8("PlayCharacterQuote", objArray1); }
public void AddGameObject(GameObject go, CanvasAnchor anchor, bool destroyOnSceneLoad, CanvasScaleMode scaleMode) { object[] objArray1 = new object[] { go, anchor, destroyOnSceneLoad, scaleMode }; base.method_8("AddGameObject", objArray1); }
public Transform GetAnchor(CanvasAnchor type) { object[] objArray1 = new object[] { type }; return(base.method_14 <Transform>("GetAnchor", objArray1)); }
private void PlayCharacterQuote(Notification quote, Vector3 position, string text, string soundName, float durationSeconds, CanvasAnchor anchorPoint = 1) { if (this.m_quote != null) { UnityEngine.Object.Destroy(this.m_quote.gameObject); } this.m_quote = quote; this.m_quote.ChangeText(text); this.m_quote.transform.position = position; this.m_quote.transform.localScale = new Vector3(0.01f, 0.01f, 0.01f); OverlayUI.Get().AddGameObject(this.m_quote.gameObject, anchorPoint, false, CanvasScaleMode.HEIGHT); if (!string.IsNullOrEmpty(soundName)) { QuoteSoundCallbackData callbackData = new QuoteSoundCallbackData { m_quote = this.m_quote, m_durationSeconds = durationSeconds }; AssetLoader.Get().LoadSound(soundName, new AssetLoader.GameObjectCallback(this.OnQuoteSoundLoaded), callbackData, false, SoundManager.Get().GetPlaceholderSound()); } else { this.PlayQuoteWithoutSound(durationSeconds); } }
public Notification CreateCharacterQuote(string prefabName, Vector3 position, string text, string soundName, bool allowRepeatDuringSession = true, float durationSeconds = 0f, System.Action finishCallback = null, CanvasAnchor anchorPoint = 1) { if (!allowRepeatDuringSession && this.m_quotesThisSession.Contains(soundName)) { return(null); } this.m_quotesThisSession.Add(soundName); Notification quote = GameUtils.LoadGameObjectWithComponent <Notification>(prefabName); if (quote == null) { return(null); } if (finishCallback != null) { quote.OnFinishDeathState = (System.Action)Delegate.Combine(quote.OnFinishDeathState, finishCallback); } this.PlayCharacterQuote(quote, position, text, soundName, durationSeconds, anchorPoint); return(quote); }
public Notification CreateCharacterQuote(string prefabName, string text, string soundName, bool allowRepeatDuringSession = true, float durationSeconds = 0f, CanvasAnchor anchorPoint = 1) { return(this.CreateCharacterQuote(prefabName, DEFAULT_CHARACTER_POS, text, soundName, allowRepeatDuringSession, durationSeconds, null, anchorPoint)); }