コード例 #1
0
ファイル: CameraComponent.cs プロジェクト: HuntiXz/phantom
 public override void OnAncestryChanged()
 {
     base.OnAncestryChanged();
     this.Camera = null;
     Component iter = this.Parent;
     while (iter != null)
     {
         if (iter is Camera)
         {
             this.Camera = iter as Camera;
             break;
         }
         iter = iter.Parent;
     }
 }
コード例 #2
0
ファイル: Layer.cs プロジェクト: HuntiXz/phantom
 public override void OnAncestryChanged()
 {
     base.OnAncestryChanged();
     this.Camera = this.GetAncestor<GameState>().GetComponentByType<Camera>();
 }